Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto reload configuration #1818

Open
jclusso opened this issue Jul 27, 2023 · 3 comments
Open

Auto reload configuration #1818

jclusso opened this issue Jul 27, 2023 · 3 comments

Comments

@jclusso
Copy link

jclusso commented Jul 27, 2023

When developing with Simple Form + Tailwind, I've found it extremely painful that you have to restart your server between every adjustment to the configuration. I was wondering if there is any reason we don't have some sort of auto reloading in development?

@btrewern
Copy link

This is not a simple_form thing, it's a Rails thing. Any time you change a file in config/initializers/ you have to restart rails.

There may be a way e.g. add the following to the top of your controller:

SimpleForm.setup do |config|
      config.button_class = 'btn btn-info'
end

This should autoload and then you can move this to your initializer when you have finished any changes.

@jclusso
Copy link
Author

jclusso commented Nov 23, 2023

I was thinking something like this could be implemented.

@borama
Copy link

borama commented Dec 2, 2023

I unfortunately don't think it is possible. I tried to play with the options in the Rails guide but I think it actually doesn't apply here. The problem seems to be that code in the Rails initializers does not get reloaded and none of the options make it reloadable. To me the most promising was the to_prepare block but this also is a callback that allows just a (static / not reloaded) code in the initializer to configure some other reloadable code.

Without moving the configuration to some other place that would get reloaded, this seems not feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants