Hello,
I have a problem setting up the gem if I want to configure it from the initializers folder.
So, when I configure the gem inside the development.rb file everything is alright
example working config:
Rails.application.configure do
config.web_console.permissions = ENV.fetch('ALLOWED_IP', nil)
end
but when I do a similar thing in my config/initializers/web_console.rb like so:
# frozen_string_literal: true
if Rails.env.development?
Rails.application.configure do
config.web_console.permissions = ENV.fetch('ALLOWED_IP', nil)
end
end
the console command is not working and the console is not appearing when an error is raised or when I manually add the console command e.g. in my controller actions.
Have you seen a problem like this before? Or do you already know that configuring the gem from config/initializers is not possible maybe?
EDIT:
After doing some console outputs it seems to me that it's just an ordering of things.
- First, it's the
config/environments/development.rb that runs
- Second it's whatever is inside the
web-console gem lib/web_console/railtie.rb that runs
- Third it's what's in the
config/initializers/web_console.rb (This is the file where I'm trying to configure web-console in my project) that is running
However, the configuration I'm setting in the config/initializers/web_console.rb is not picked up by the gem.
Hello,
I have a problem setting up the gem if I want to configure it from the
initializersfolder.So, when I configure the gem inside the
development.rbfile everything is alrightexample working config:
but when I do a similar thing in my
config/initializers/web_console.rblike so:the
consolecommand is not working and the console is not appearing when an error is raised or when I manually add theconsolecommand e.g. in my controller actions.Have you seen a problem like this before? Or do you already know that configuring the gem from
config/initializersis not possible maybe?EDIT:
After doing some console outputs it seems to me that it's just an ordering of things.
config/environments/development.rbthat runsweb-consolegemlib/web_console/railtie.rbthat runsconfig/initializers/web_console.rb(This is the file where I'm trying to configureweb-consolein my project) that is runningHowever, the configuration I'm setting in the
config/initializers/web_console.rbis not picked up by the gem.