I have a controller promos. When the edit action is called the
following error is given -
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id

For simplicity the controller and view looks like this:

promos_controller.rb
--------------------------------
def edit
 @promo = Promo.find(params[:id])
end
------------------------------
edit.html.erb
-------------------------------
<%= @promo.id %>
----------------------------

However when I change the instance variable to say @home, or anything
else the view correctly displays the results.

Could anyone explain why it wouldn't work for @promo?

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

Reply via email to