Skip to content

Conversation

@lylo
Copy link

@lylo lylo commented Dec 6, 2025

Summary

When using Lexxy 0.1.23.beta with Rails 8.2.0.alpha, the lexxy_rich_text_area helper raises:

NoMethodError: undefined method 'dom_id' for an instance of ActionView::Helpers::Tags::ActionText

This happens because when Lexxy::ActionTextTag is prepended to ActionView::Helpers::Tags::ActionText, the dom_id method (which Rails delegates to ActionView::RecordIdentifier) isn't accessible from within the prepended module's methods.

Fix

Add an explicit delegation using ActiveSupport::Concern's prepended block, which runs when the module is prepended and sets up the delegation on the target class.

Test plan

  • Existing system tests in form_test.rb exercise the form helper which uses dom_id
  • Tested manually with a Rails 8.2.0.alpha application

When ActionTextTag is prepended to ActionView::Helpers::Tags::ActionText,
the dom_id method isn't accessible from the prepended module. This adds
an explicit delegation using ActiveSupport::Concern's prepended block.
@lylo
Copy link
Author

lylo commented Dec 6, 2025

I'm currently monkey-patching this in my app which works for the time being.

Rails.application.config.to_prepare do
  Lexxy::ActionTextTag.module_eval do
    delegate :dom_id, to: ActionView::RecordIdentifier
  end
end

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant