diff options
| author | Zog | 2018-01-24 08:58:28 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-01-31 07:16:22 -0800 |
| commit | 87e0ea06cbc6bdfb281da8805b0221868341fee2 (patch) | |
| tree | 4b2303f8b37984555271ca2a501d4c90ea11eff0 /config | |
| parent | d56aed95bcd9970bdc49477c2d5c59befbaeeefd (diff) | |
| download | chouette-core-87e0ea06cbc6bdfb281da8805b0221868341fee2.tar.bz2 | |
Add a toolbar for devs to easily manage permissions and features
Diffstat (limited to 'config')
| -rw-r--r-- | config/environments/development.rb | 7 | ||||
| -rw-r--r-- | config/routes.rb | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index 24a4ed6b8..925718e69 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -95,4 +95,11 @@ Rails.application.configure do config.i18n.available_locales = [:fr, :en] config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload) if ENV['LIVERELOAD'] + config.development_toolbar = false + if ENV['TOOLBAR'] && File.exists?("config/development_toolbar.rb") + config.development_toolbar = OpenStruct.new + config.development_toolbar.tap do |toolbar| + eval File.read("config/development_toolbar.rb") + end + end end diff --git a/config/routes.rb b/config/routes.rb index 6a6a7cb07..07370ee6d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -239,6 +239,10 @@ ChouetteIhm::Application.routes.draw do get '/help/(*slug)' => 'help#show' + if Rails.application.config.development_toolbar + post "/development_toolbar" => "development_toolbar#update_settings", as: :development_toolbar_update_settings + end + match '/404', to: 'errors#not_found', via: :all, as: 'not_found' match '/403', to: 'errors#forbidden', via: :all, as: 'forbidden' match '/422', to: 'errors#server_error', via: :all, as: 'unprocessable_entity' |
