Rails 6.1 has released an improvement for a tag_helper (specifically for the rich_text_area from ActionText), that I would require now, for my Rails 6.0.x app. Basically the improvement is a very small change in just one line of code, so it should be simple to just monkey patch the current rails method and get the improvement now, right?
Specifically I'm trying to monkey patch the following ActionText tag helper method (link to Github rails/rails) with the following code, but the code is not applied. What am I doing wrong?
lib/core_ext/rich_text_area.rb
module ActionView::Helpers
class Tags::ActionText < Tags::Base
def render
options = @options.stringify_keys
debugger
add_default_name_and_id(options)
options["input"] ||= dom_id(object, [options["id"], :trix_input].compact.join("_")) if object
@template_object.rich_text_area_tag(options.delete("name"), options.fetch("value") { editable_value }, options.except("value"))
end
end
end
Added the following to a file in config/initializers
Dir[File.join(Rails.root, 'lib', 'core_ext', '*.rb')].each { |l| require l }