I got a view with the following code:
<%= form_for(@stock,:url=>{:action=>"buyback"},:html=>{:class=>"form-horizontal"}) do |f| %>
My routes.rb file shows:
post '/stocks/buyback'
When I click the submit button of the form, it does not trigger the method buyback of the controller but instead update.
The log file shows:
Started PUT "/stocks/buyback" for 127.0.0.1 at 2012-07-22 19:46:07 +0800
Processing by StocksController#update as HTML
Its triggering the controller method Update instead of buyback. Why?
try this