I have a comments controller:
match 'comments/count' => 'comments#count'
resources :comments
I’m trying to map mysite.com/comments/count to a newly defined count action within the comment controller. What I have above doesn’t seem to work. I get the following error:
Unknown action
The action ‘show’ could not be found for CommentsController
even though i think that this should work, there are better ways to do this. have a look at the
memberandcollectionattributes of resources:http://guides.rubyonrails.org/routing.html#adding-more-restful-actions
in your case i think this would be