Skip to content

Conversation

@jorgemanrubia
Copy link
Member

Reverts the previous patch from #2381.

The problem was that I hadn't update Lexxy in the saas version basecamp/lexxy#596

I added a test too. Reproduction script:

# Run with: bin/rails runner tmp/reproduce_missing_attachable.rb
#
# This script reproduces the issue where rendering a rich text field with
# a missing attachable looks for the partial in the wrong namespace
# (e.g., cards/action_text/attachables/_missing_attachable instead of
# action_text/attachables/_missing_attachable)

require "action_controller/test_case"

puts "=" * 60
puts "Testing ActionText attachment rendering with missing attachable"
puts "=" * 60
puts

card = Card.first
puts "Using card: #{card.title} (#{card.id})"

card.update! description: <<~HTML
  <action-text-attachment sgid="gid://fizzy/Card/nonexistent" content-type="application/octet-stream"></action-text-attachment>
HTML

puts "Updated card description with missing attachment HTML"
puts

module Cards
  class TestController < ApplicationController
    def test_render
      view_context.lexxy_rich_textarea_tag(:description, @card.description)
    end
  end
end

controller = Cards::TestController.new
controller.instance_variable_set(:@card, card)

request = ActionDispatch::TestRequest.create
controller.set_request!(request)
controller.set_response!(ActionDispatch::Response.new)

puts "Rendering from Cards:: namespaced controller..."
puts

begin
  controller.test_render
  puts "SUCCESS - No error when rendering missing attachable"
rescue ActionView::MissingTemplate => e
  puts "FAILURE - #{e.message.lines.first}"
  exit 1
end

Reverts the previous patch. The problem was that I hadn't update
 Lexxy in the saas version basecamp/lexxy#596
@jorgemanrubia jorgemanrubia merged commit 99a8d12 into main Jan 16, 2026
12 checks passed
@jorgemanrubia jorgemanrubia deleted the attachment-take-2 branch January 16, 2026 16:36
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.

2 participants