diff --git a/app/controllers/console_controller.rb b/app/controllers/console_controller.rb new file mode 100644 index 0000000000..22c4579953 --- /dev/null +++ b/app/controllers/console_controller.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +# On webpage console for dev environments +class ConsoleController < ApplicationController + def show; end +end diff --git a/app/views/console/show.html.erb b/app/views/console/show.html.erb new file mode 100644 index 0000000000..bedad8be0e --- /dev/null +++ b/app/views/console/show.html.erb @@ -0,0 +1,5 @@ +

Rails Console

+ +<% if Rails.configuration.enable_web_console == false %> + <%= console %> +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 021c0fbd04..78425a6920 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -40,5 +40,9 @@ <% end %> <% end %> <% end %> + + <% if Rails.env.development? and Rails.configuration.enable_web_console == true %> + <%= console %> + <% end %> diff --git a/config/environments/development.rb b/config/environments/development.rb index 52771fc020..2db3bc25d7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -102,6 +102,8 @@ ] } + config.enable_web_console = false + # Create a new production log file [daily, weekly, monthly,..] # if ENV['RAILS_DAILY_LOG_ROTATION'].present? # logger = ActiveSupport::Logger.new(config.default_log_file, 'daily') diff --git a/config/routes/development.rb b/config/routes/development.rb index 8f34fe10ee..a994ea29ae 100644 --- a/config/routes/development.rb +++ b/config/routes/development.rb @@ -7,5 +7,7 @@ get '/rails/info/routes' => 'rails/info#routes' get '/rails/info' => 'rails/info#index' + get '/console', to: 'console#show' + mount Lookbook::Engine, at: '/rails/lookbook' end