bootstrap-ruby / bootstrap_form

Official repository of the bootstrap_form gem, a Rails form builder that makes it super easy to create beautiful-looking forms using Bootstrap 5.
MIT License
1.64k stars 352 forks source link

Remove the require expression for action text in lib/bootstrap_form.rb #720

Closed jdufresne closed 7 months ago

jdufresne commented 7 months ago

This require was added in e6f5b09209147143ebdb83032a50e9758cfdc2ab to add ActionText support.

Instead of eagerly loading the module, allow the Rails engine subsystem to load the helpers as necessary.

Eagerly loading the module has the downside of defining the module ActionText even when the engine is not in use. Defining the module like this can "trick" other gems into erroneously loading their ActionText support, which may lead to confusing and out of context error messages.

Fixes #719

jdufresne commented 7 months ago

I would appreciate it if someone that uses ActionText in their project could test this branch and report what errors they see and when.

lcreid commented 7 months ago

The demo app (in the demo directory) uses ActionText and it seems to run fine. I don't have any other current apps that use ActionText, but I'll probably merge this and see if we get complaints from people using the code from main.