title: Get list of routes for a resource in Rails
body: <p>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--</p>
  
  <pre><code>  resources :survey_generation, only: [:index, :create]
    get "survey_generation/base_objects"
  </code></pre>
  
  <p>Is there a way for me to get the actions available on the survey_generation resource i.e. (index, create and base_objects)?</p>
  
  <p>Edit: I want to do it programmatically in my code, not on the console using rake routes.</p>