Eelke Wolters wrote:> You have a nil object when you didn''t expect it!
> You might have expected an instance of ActiveRecord::Base.
> The error occurred while evaluating nil.[]>
> I made a simple pages admin. When i tried to automate the permalink by
> adjusting the title i got tis error the model is enclosed in the
> attachment.
> whatever is commented on the page i do not wish to have on my page
> anymore, but i did not wan''t to delete them either,
You posed the wrong code. This error is not happening in your view code
it''s happening in your controller.
You need to examine the code used to find @page. My guess is that it
trying to do something like:
@page = Page.find(x)
Where x used to be the id of the record to find, but it now a string
containing your permalink. That''s is purely a guess since you
didn''t
post the controller code that is throwing this exception.
So basically Rails is telling you that you were probably expecting
form_for(@page) to be a form for an ActiveRecord::Base instance, but you
are actually creating a form for nil form_for(nil).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---