Ruby on Rails Friday, July 1, 2011

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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment