routes.rb
resources :home do
get 'download', :on => :collection
end
rake routes
download_home_index GET /home/download(.:format) home#download
home_index GET /home(.:format) home#index
....
home_controller.rb
def index
end
When i go to http://localhost:3000/home/download, it works even though there is no "download" action in the home_controller. I am confused why even without the action, it doesn't complain missing action.
I was curious so I added resources :homes to routes.rb and rake routes gave me the following:
homes GET /homes(.:format) homes#index
In comparison, it is not homes_index whereas it was home_index before. Is there some rails magic going on? Appreciate some explanation.