Routing error for custom POST route in Rails 3

I’ve been banging my head against this for a while, and would love to
see someone prove that I am just overlooking something simple.

I am trying to add a custom route to my RESTful resource. Because
route is destructive, I want to use “POST” http method. If I hack my
routes.rb to use GET, everything works just fine:

2 different server runs, only difference is get vs. post in my

Started POST “/maps/1/reload_from_deamon” for at Sun Oct 17
23:17:32 -0700 2010
ActionController::RoutingError (No route matches “/maps/1/

Started GET “/maps/1/reload_from_deamon” for at Sun Oct 17
23:26:53 -0700 2010
Processing by MapsController#reload_from_deamon as HTML

Here are my symptoms:

resources :maps do
member do
post ‘reload_from_deamon’

i’ve also tried

resources :maps do

post ‘reload_from_deamon’, :on => :member


match ‘maps/:id/reload_from_deamon’ =>

“maps#reload_from_deamon”, :via => :post

def reload_from_deamon
@map = Map.find(params[:id])
status = @map.reload_from_deamon
redirect_to @map, :notice => status

I generate my post form as following, this might be what is killing
me. I’ve been unable to coerce form_for to generate the proper POST
url for me.

<%= form_for @map, :url => map_path(@map)+ “/reload_from_deamon” do |
f| -%>

Refresh readers from deamon

<% end -%>

Any ideas?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs