Search code examples
ruby-on-rails-3activerecordattributesmass-assignment

Get mass assignable attributes for model


How can i get mass assignable attributes for model?

I found this, but it seems to me kinda dirty.

Game.accessible_attributes.to_a.reject{|i| i.empty?}

Is there any cleaner way?


Solution

  • I don't understand why the is the reject function.

    Did you try this :

    Game.accessible_attributes