public
Created

  • Download Gist
routes_1.rb
Ruby
1 2 3 4 5
get "/about" => 'info#about', :as => 'about'
get "/privacy" => 'info#privacy', :as => 'privacy'
get "/license" => 'info#license', :as => 'license'
get "/mission" => 'info#mission', :as => 'mission'
get "/contact" => 'info#contact', :as => 'contact'
routes_2.rb
Ruby
1 2 3
%w[about privacy license mission contact].each do |action|
get "/#{action}" => 'info#' + action, :as => action
end
routes_3.rb
Ruby
1 2 3
InfoController.action_methods.each do |action|
get "/#{action}" => 'info#' + action, :as => action
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.