I have a controller called banana.rb
In routes.rb I have:
resources :banana, :path => "ban_fruit" do
get 'list'
end
And in the browser, I hit http://host.com/ban_fruit/list.json
But it errors, telling me: "The action 'show' could not be found for BananaController"
I need http://host.com/ban_fruit/list.json to work, how can I do this without renaming my controller?
Try out like following:
get 'ban_fruit/list' => 'banana#list'
#
# ban_fruit_list GET /ban_fruit/list(.:format) banana#list
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments