Skip to content

Instantly share code, notes, and snippets.

@matisojka
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matisojka/3dd7d7df19a5ca0a6835 to your computer and use it in GitHub Desktop.
Save matisojka/3dd7d7df19a5ca0a6835 to your computer and use it in GitHub Desktop.
Splitting routes into modules
YourApplication::Application.routes.draw do
root to: 'home#index'
get '/about'
get '/login' => 'application#login'
end
ADDITIONAL_ROUTES = [:messages, :orders, :api, :admin]
ADDITIONAL_ROUTES.each do |route_file|
require "#{Rails.root}/config/routes/#{route_file}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment