Is there a way in Rails to programmatically get all routes (derived from routes.rb) for a given resource? For example, if this is the resource defined in routes.rb--
resources :survey_generation, only: [:index, :create]
get "survey_generation/base_objects"
Is there a way for me to get the actions available on the survey_generation resource i.e. (index, create and base_objects)?
Edit: I want to do it programmatically in my code, not on the console using rake routes.
I think this fellow did what you want to do:
If that's not quite right I'd still suggest doing what he did - look at the Rails source for the :routes
rails task and work backward.