successfully creates a nice url helper [change_state_project_url(82)]
which results in: “/projects/82;change_state”
and a error message:
ActionController::RoutingError (no route found to match “/projects/
82;change_state” with {:method=>:post}):
.//vendor/rails/actionpack/lib/action_controller/routing.rb:
1264:in recognize_path' .//vendor/rails/actionpack/lib/action_controller/routing.rb: 1254:inrecognize’
In the projects controller I have an action as such (trimmed):
def change_state
end
which responds to a non-restful route request [/projects/change_state]:
(btw, I have tested :post and :get. same result)
does this ring any bells? I’m looking for inspiration.
bueller? bueller?
thanx.
Jodi
General Partner
The nNovation Group inc.
www.nnovation.ca/blog
ActionController::RoutingError (no route found to match “/projects/
82;change_state” with {:method=>:post}):
You defined a route as a :put, but are calling it as a :post. Try:
change_state_project_url(82,:method=>:put)
or change your route to
map.resources :project, :member => { :change_state => :post }
ActionController::RoutingError (no route found to match “/projects/
82;change_state” with {:method=>:post}):You defined a route as a :put, but are calling it as a :post. Try:
change_state_project_url(82,:method=>:put)
or change your route to
map.resources :project, :member => { :change_state => :post }
doh!
thanx Michael.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.