Created
August 1, 2012 14:37
-
-
Save roolo/3227397 to your computer and use it in GitHub Desktop.
How to get mass assignable attributes for model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Loading development environment (Rails 3.2.6) | |
| 1.9.2p320 :001 > Game.accessible_attributes | |
| => #<ActiveModel::MassAssignmentSecurity::WhiteList: {"", "name"}> | |
| 1.9.2p320 :002 > Game.accessible_attributes.to_a | |
| => ["", "name"] | |
| 1.9.2p320 :003 > Game.accessible_attributes.to_a.reject{|i| i.empty?} | |
| => ["name"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment