In a Ruby on Rails application I want to have this routing:
- for URL www.example.com/reports go to controller
documentsand actionreports - for URL www.example.com/charts go to controller
documentsand actioncharts
In the routes.rb file I currently have:
scope controller: :documents do
get 'reports' => :reports
get 'charts' => :charts
end
The code works as expected, but is there a way so I keep the code dry and don't repeat the action names?