nil.to_sym object_path

0 views
Skip to first unread message

Jason Boxman

unread,
Apr 3, 2008, 9:49:11 PM4/3/08
to resource_controller
For the latest stable and today's trunk I find object_path(an_object)
mysteriously doesn't work in a template now.

<% for instance in @collection %>
<%= link_to instance.name, object_path(instance) %>
<% end %>

I know it worked with the last stable release, since it worked when I
checked in yesterday. I can still call named_route_path(instance) and
have a path generated correctly.

Not sure what I need to do differently with the newer version?

The template is loaded by a FoosController that inherits from
BarsController which calls the resource_controller class method. I
have route_name, object_name, and model_name defined in FoosController
accordingly.

Thanks.

James Golick

unread,
Apr 3, 2008, 9:52:44 PM4/3/08
to resource_...@googlegroups.com
Strange... does it work in the controller?

Jason Boxman

unread,
Apr 3, 2008, 9:55:51 PM4/3/08
to resource_controller
Ugh.

I had route_name as the pural.

Nevermind.

darth timeus

unread,
May 16, 2008, 11:22:34 AM5/16/08
to resource_controller
Hi I have the same problem and i'm new to RoR how do you fix it?

Thanks
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

James Golick

unread,
May 17, 2008, 12:38:03 PM5/17/08
to resource_...@googlegroups.com
Hey Darth,

It really depends on the context. If you're having this error, I'll need to know more about the situation before I can help you fix it.
Reply all
Reply to author
Forward
0 new messages