This project is archived and is in readonly mode.

#3971 ✓invalid
quinn shanahan

polymorphic_path seems to be calling incorrect path method

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

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

Comments and changes to this ticket

  • fakingfantastic

    fakingfantastic May 16th, 2010 @ 08:14 PM

    -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

    -    <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.

  • Rizwan Reza

    Rizwan Reza May 16th, 2010 @ 08:15 PM

    • State changed from “new” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages