3

I understand that Action Text attachments are store in the DB in a compressed form that appears as an "action-text-attachment" tag. However when rendered using to_trix_html this tag is not rendered as I suppose it would mess with Trix's internal model.

I cannot understand why this tag is required when Rich Text is rendered as HTML (for example in a show action). I'd really appreciate if someone could explain why this has been designed this way.

ayushn21
  • 305
  • 2
  • 7

1 Answers1

1

its need to be there as an identifier and its saved like that inside the database

the tag contain 5 attributes content-type url filename filesize and sgid

sgid is Signed Global IDs its unique to each file the function is as an anti-tamper and identifier about the attached file

as for the .to_trix_html giving different tag yes its need to be like that

because we want different way to handle the attachment inside the trix editor and when it outside the trix editor.

and if you want to know more about how the attachments works in action_text you could check this blog post

buncis
  • 2,148
  • 1
  • 23
  • 25