-
Notifications
You must be signed in to change notification settings - Fork 356
Closed
Labels
Description
My application doesn't use ActionText.
Either way, Rails bootstrap_form loads it at:
bootstrap_form/lib/bootstrap_form.rb
Lines 1 to 9 in ed3eda8
| # NOTE: The rich_text_area and rich_text_area_tag helpers are defined in a file | |
| # with a different name and not in the usual autoload-reachable way. | |
| # The following line is definitely need to make `bootstrap_form` work. | |
| # rubocop:disable Lint/SuppressedException | |
| begin | |
| require "#{Gem::Specification.find_by_name('actiontext').gem_dir}/app/helpers/action_text/tag_helper" | |
| rescue Gem::MissingSpecError | |
| end | |
| # rubocop:enable Lint/SuppressedException |
This require statement creates the ActionText module which "tricks" other gems into loading their ActionText support. These gems may do something like:
if defined?(ActionText)
# Load ActionText support ...
endThis can result in a confusing error message later on when this loaded support eventually fails.
One example of this is RailsAdmin:
I'm wondering if bootstrap_form could somehow use lazy loading to prevent creating the global ActionText module until necessary. If possible, this would improve compatibility between these gems when ActionText is not used.
wvengen