Skip to content

Commit

Permalink
Remove the require expression for action text in lib/bootstrap_form.rb (
Browse files Browse the repository at this point in the history
#720)

This require was added in e6f5b09 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.
  • Loading branch information
jdufresne authored Nov 29, 2023
1 parent 9a358fe commit df6f7e9
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/bootstrap_form.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# 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

require "action_view"
require "action_pack"
require "bootstrap_form/action_view_extensions/form_helper"
Expand Down

0 comments on commit df6f7e9

Please sign in to comment.