This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Routing::Routes.draw do | |
root to: "home#index" | |
get "/about | |
get "/login" => "application#login" | |
namespace :api do | |
#nested resources | |
end | |
namespace :admin do | |
#nested resources | |
end | |
namespace :messages do | |
#nested resources | |
end | |
namespace :orders do | |
#nested resources | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.paths["config/routes"] += Dir[Rails.root.join('config/routes/*.rb’)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YourApplication::Application.routes.draw do | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
draw :messages | |
draw :orders | |
draw :api | |
draw :admin | |
root to: "home#index" | |
get "/about | |
get "/login" => "application#login" | |
end |
http://blog.arkency.com/
Comments
Post a Comment