I've been grepping the output of rake routes
forever and it just dawned on me that someone must know a better way to inspect routes. I have a resource in my routes.rb
name account_groups
:
resources :account_groups
Is there anyway to tell rake routes
to only return the routes associated with this resource?
Resource routing allows you to quickly declare all of the common routes for a given resourceful controller. A single call to resources can declare all of the necessary routes for your index , show , new , edit , create , update , and destroy actions.
rake routes will list all of your defined routes, which is useful for tracking down routing problems in your app, or giving you a good overview of the URLs in an app you're trying to get familiar with.
We have to define the routes for those actions which are defined as methods in the BookController class. Open routes. rb file in library/config/ directory and edit it with the following content. The routes.
You can check for routes of specific controller:rake routes CONTROLLER=account_groups
As seen in @ZiiCEagle's answer this is deprecated now and you should userails routes -c account_groups
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With