Jorge Wander
2011-Jul-01 15:11 UTC
Error creating a validation in model when i have a before_filter on my controller
I dont know why, but my application run without errors when i dont put the line: "validates :age, :numericality => true" on my model if i put that line in the model, this one error appear: " You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.map Extracted source (around line #19): 16: <%= f.text_field :value %> 17: </div> 18: <div class="field"> 19: <%= f.select(:owner_id, options_from_collection_for_select(@owners, :id, :name)) %> 20: </div> 21: <div class="field"> 22: <%= f.select(:reservation_type_id, options_from_collection_for_select(@reservation_types, :id, :name))%> " I think that the before_filter is been skipped, but i don''t know why or how i could resolve it.... I hope that someone can help me to understand this, and thx. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.