Restful routing question


I was wondering if you guys could help me out.

i have a link_to url like so: discard_contents(current_project, :to_project_id => params[:id]) # => http://localhost:3000/projects/1163131/discard_contents?to_project_id=1121802

but I keep getting this "No action responded to 1163131" error

I am guessing it's some issue with my routing configuration, but I'm not seeing it..

#from routes.rb

map.resources :projects, :member => { ... :move_or_discard_contents => :any, :move_contents => :post, :discard_contents => :post }, :collection => { ... } do |project|


/projects/discard_contents/1163131?to_project_id=1121802 works.

any ideas?

I know this is probably obvious, but you have verified the route exists and looks right with "rake routes" and have restarted your server recently enough that it has the route, yes?

Yep.. I have done both. This is the output from my rake routes.

discard_contents_project POST /projects/:id/discard_contents(.:format) {:controller=>"projects", :action=>"discard_contents"}

It seems like it should be a valid route...

I found it: :method => :post. The method needed to be explicitly set since the route only allows the path if the request method is post.