Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

polymorphic_path seems to be calling incorrect path method

#3971

in my router i have

  resources :user

and when I try to use form_for or passing an object into a link_to I get a NoMethodError error:

undefined method user__path' for #<Class>

Also, it doesn't seem to happen on the first page request after the server has been restarted. The error seems to be happening in polymorphic_path. I am using the gem obtained by gem install rails --pre

Reported by quinn shanahan · February 16th, 2010 @ 07:41 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. fakingfantastic
    fakingfantastic

    -1

    Pretty sure this may have been cleaned up over the month, but i didn't get the result

    rails newapp
    rails g scaffold user name:string

    in routes.rb s/resources :users/resources :user/

    GET /user/new & make a user record
    update app/views/users/index.html.erb line #15 Doc for ActionController::Resources::Resource.resources

    -    <td><%= link_to 'Show', user %></td>
    +    <td><%= link_to 'Show', polymorphic_path(user) %></td>
    

    GET /user

    Note the lack of fail, and the working link.

    May 16th, 2010 @ 08:14 PM

  2. Rizwan Reza
    Rizwan Reza
    • State changed from new to invalid

    May 16th, 2010 @ 08:15 PM