Rails 3 - Thumbs up - Routing problem?
Hi I've got a project where I'm using Thumbs_up, when you enter a single retailer you can either vote it up or down. It works like a charm.
But now I try to add this feature to a index page of all retailers and it starts to give me error when I try to post the action with a form.
This is the error I receive on the "index" page.
Started POST "/retailers/lensesonly/vote_down" for 127.0.0.1 at 2011-05-09 13:02:02 +0200
ActionController::RoutingError (No route matches "/retailers/lensesonly/vote_down"):
And then when I enter the single page of a retailer and votes it up it gives me this.
Started POST "/retailers/lenssavers/vote_down" for 127.0.0.1 at 2011-05-09 13:05:13 +0200
Processing by RetailersController#vote_down as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"asd.../0i5fcCO7+asd=", "commit"=>"", "id"=>"lenssave开发者_开发百科rs"}
Why is it like this? What am I doing wrong? The forms look exactly the same when you look at it in a browser (FF-Firebug).
The url's you are showing are different:
/retailers/lenssavers/vote_down
is the working url. While this one fails:
/retailers/lensesonly/vote_down
Are you missing a definition in your routes.rb
for lensesonly
?
You can easily check your routes by running rake routes
on the command-line, in your rails root folder.
精彩评论