Sha256: afbb310ca5b2e46ce05915b07feaba3bccbe665d7406efcc72860f280f0b9914

Contents?: true

Size: 554 Bytes

Versions: 10

Compression:

Stored size: 554 Bytes

Contents

# In development mode, we need to ensure that all controllers are loaded,
# because that's how AdminAssistant knows what routes to create
unless Rails.configuration.cache_classes
  controllers_path = "#{Rails.root}/app/controllers"
  AdminAssistant.all_files_under(controllers_path).each do |path|
    if path =~ /\.rb$/
      if File.readlines(path).any? { |line| line =~ /admin_assistant_for/ }
        require path
      end
    end
  end
end

Rails.application.routes.draw do
  AdminAssistant.routes.each do |route|
    route.add(binding)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
admin_assistant-2.4.0 config/routes.rb
admin_assistant-2.3.2 config/routes.rb
admin_assistant-2.3.1 config/routes.rb
admin_assistant-2.3.0 config/routes.rb
admin_assistant-2.2.8 config/routes.rb
admin_assistant-2.2.7 config/routes.rb
admin_assistant-2.2.6 config/routes.rb
admin_assistant-2.2.5 config/routes.rb
admin_assistant-2.2.4 config/routes.rb
admin_assistant-2.2.3 config/routes.rb