Hi, everyone.  I'm working on a program in Rails 3.0.10 and it has a
custom action, "run_files", that extracts data in files and saves it in
database.  When I clicked the link on the page, it returned an error
page:
  ActiveRecord::RecordNotFound in ReportsController#show
    Couldn't find Report with ID=run_files

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/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to