Skip to content

Instantly share code, notes, and snippets.

@jasonayre
Created February 20, 2015 21:47
Show Gist options
  • Save jasonayre/9c7a0f31417654cc8532 to your computer and use it in GitHub Desktop.
Save jasonayre/9c7a0f31417654cc8532 to your computer and use it in GitHub Desktop.
mounted_routes_for_engine
module ReportingApi
class Engine < ::Rails::Engine
isolate_namespace ReportingApi
::Dir[root.join('app', 'controllers', 'reporting_api', 'concerns', '*.rb')].each do |file|
require file
end
initializer "reporting_api.routes" do
::ActiveSupport.on_load(:after_engines_mounted) do |klass|
puts ::Kore::Engines.mounted_path_for_engine(ReportingApi::Engine)
end
end
end
end
Rails.application.routes.draw do
# root :to => "dashboard#index"
# devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
namespace :org do
resource :organization
end
mount ::Admin::Engine, at: "admin"
mount ::ReportingApi::Engine, at: "api/reporting"
mount ::BallotFront::Engine, at: ""
mount ::BallotApi::Engine, at: "api"
::ActiveSupport.run_load_hooks(:after_engines_mounted, self)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment