debian-mirror-gitlab/config/initializers/routing_draw.rb

8 lines
242 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
# Adds draw method into Rails routing
# It allows us to keep routing splitted into files
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end