Does rails provide a way to ignore extra keys that are passed in to create. Supposed User has two attributes, first_name and last_name. When I do
User.create({ :first_name => "first", :last_name => "last", :age => 10})
that line gives me an UknonwnAttributeError. Well, that makes sense, it happens cause age is not one of the attributes.
But is there a way to just ignore key-value pair that is not one of the attributes for User?
Either what sameera207 said or
Ultimately you could override your User model’s create method to reject unexacting attributes but i think that’s not appropriate.