This project is archived and is in readonly mode.

#1856 ✓wontfix
Piotr Sarnacki

Routes problem

Reported by Piotr Sarnacki | February 3rd, 2009 @ 10:36 AM

Hi,

I have namespace admin in my app:


map.namespace(:admin) do |admin|
  admin.resources :articles
  #.... more admin routes
end

After changing rails version to 2.3.0 I've got "No action responded to 1" error while trying to GET "/admin/opinions/1".

Comments and changes to this ticket

  • Rocco Di Leo

    Rocco Di Leo February 3rd, 2009 @ 12:51 PM

    I have the same problem.

    The rake routes command shows a correct definition:

    clubs GET /clubs/:id/(.:format) {:action=>"show", :controller=>"clubs"}

    This call will result in a "No action responded to the-club-to-view"-error:

    http://localhost/clubs/the-club-...

    This call works:

    http://localhost/clubs/show/the-...

    Greets Rocco

  • Rocco Di Leo

    Rocco Di Leo February 3rd, 2009 @ 01:08 PM

    In addition to this problem .. nested routes do not work either:

    map.resource :cms do |sub|

    sub.resources :categories
    
    

    end

    calling /cms/categories in the browser results again in a "No action responded to categories"

    Greets Rocco

  • Pascal Ehlert

    Pascal Ehlert February 3rd, 2009 @ 01:48 PM

    Is there any chance that you have the desert plugin installed?

  • Rocco Di Leo

    Rocco Di Leo February 3rd, 2009 @ 02:34 PM

    no, i have not installed the desert plugin.

  • DHH

    DHH February 3rd, 2009 @ 04:32 PM

    • Milestone cleared.
    • Assigned user set to “josh”
  • josh

    josh February 3rd, 2009 @ 11:28 PM

    • State changed from “new” to “wontfix”

    Unable to reproduce with a fresh rails app.

    Can you please create a reproducible unit tests against the actionpack tests.

  • Rocco Di Leo

    Rocco Di Leo February 4th, 2009 @ 06:24 AM

    I can reproduce the problem on Mac Os X 10.5.6 with a fresh rails 2.3.0 application by doing:

    Create a new app with one resource

    rails testapp ... cd testapp script/generate controller clubs (adding map.resources :clubs to routes.rb) rake routes

    *Correctly outputs the generated resources:*

    clubs GET /clubs(.:format) {:action=>"index", :controller=>"clubs"}

          POST   /clubs(.:format)                   {:action=>"create", :controller=>"clubs"}
    
    

    new_club GET /clubs/new(.:format) {:action=>"new", :controller=>"clubs"} edit_club GET /clubs/:id/edit(.:format) {:action=>"edit", :controller=>"clubs"}

     club GET    /clubs/:id(.:format)               {:action=>"show", :controller=>"clubs"}
          PUT    /clubs/:id(.:format)               {:action=>"update", :controller=>"clubs"}
          DELETE /clubs/:id(.:format)               {:action=>"destroy", :controller=>"clubs"}
                 /:controller/:action/:id           
                 /:controller/:action/:id(.:format) 
    
    

    Let's test the route in the Console

    ./script/console Loading development environment (Rails 2.3.0) >> rs = ActionController::Routing::Routes ... >> rs.recognize_path('/clubs') => {:action=>"index", :controller=>"clubs"} <- Okay! >> rs.recognize_path('/clubs/1') => {:action=>"1", :controller=>"clubs"} <- NOT okay! action should be "show" and i miss the :id => 1

    Hope this helps.

    Greets -act

  • Rocco Di Leo

    Rocco Di Leo February 4th, 2009 @ 06:27 AM

    Sorry, the Formatting is quiete bad in the last post (preview option would be great here :) )

    Anyways, when generating a new rails app with 2.3.0, generating a controller and adding it's resource in routes.rb and then trying to validate the route in the console, i get the same wrong result (/clubs/1 routes to :controller => clubs with :action => 1 instead of :controller => clubs, :action => 'show' and :id => 1

    greets -act

  • Rocco Di Leo

    Rocco Di Leo February 4th, 2009 @ 06:36 AM

    And a final note .. the recognition in the console works when invoking the command with an additional method-option:

    rs.recognize_path('/clubs/1', :method => :get) => {:action=>"show", :controller=>"clubs", :id=>"1"}

    rs.recognize_path('/clubs/1') => {:action=>"1", :controller=>"clubs"}

    I thought that :get is magically called when ommitting.

    greets -act

  • Rocco Di Leo

    Rocco Di Leo February 4th, 2009 @ 06:42 AM

    okay, forget all my last three postings. i basically just proved that indeed the routing works with a fresh rails 2.3.0 installation. Doesnt solve my problem with my updated application but i guess you can close the ticket after all, since it seems to be an individual applcation problem on my side.

    final greet :) -act

  • Rocco Di Leo

    Rocco Di Leo February 4th, 2009 @ 08:10 AM

    • Assigned user cleared.

    for those interested .. i located the problem. The rails plugin "smurf" (a js/css-Minifier) was the reason that the routing broke in Rails 2.3.0 for me.

    After removal, the routing worked as expected.

    I have not taken a too closer look at its code, but just in case you happen to have the same problem, check your installed plugins one by one.

    The plugin can be found for audit at http://github.com/thumblemonks/s...

    Greets Rocco

  • Gus

    Gus March 8th, 2009 @ 11:25 PM

    actraiser,

    I just saw this ticket. On 2/16, I made changes to smurf to fix something identified by cainlevy. I'm also using smurf with Rails 2.3.1 right now without any problems. If you would like to, please get the latest smurf and try again. Let me know if there are any more problems.

    • gus (aka a thumble monk)

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>

Tags

Pages