I wonder why Rails rendered show instead of the custom action.
Following is the view file, route file and the output of rake routes.
index.html.erb
<%= link_to "Process Files", :controller => 'reports', :action =>
'run_files' %>
routes.rb
match "reports/run_files" => "reports#run_files", :via => :post
resources :reports
output of rake routes
reports_run_files POST /reports/run_files(.:format)
{:controller=>"reports"
, :action=>"run_files"}
...
..
Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
Thanks Tim. I tried both and they work! But I noticed that it
generated one more sql query when a GET request's sent than that when a
POST request's sent.
<-[1m<-[35mSQL (0.0ms)<-[0m SELECT name FROM sqlite_master WHERE
type = 'table' AND NOT name = 'sqlite_sequence'
Where is it from and is it possible to skip it?