Define Custom Routes Using the Member and Collection Blocks in Rails
Let's say you want to add non-resourceful custom routes on your controller. Most often, you're better off by introducing a new resourceful controller. However, in those cases where you absolutely have to, you can define new routes using the member and collection blocks provided by the Rails router.