Andrew Broad

Joined

10,090 Experience
100 Lessons Completed
0 Questions Solved

Activity

Posted in Routing Concerns and Scopes in Rails Discussion

Hey Chris, thanks for making a video on this and so quickly. I had been wanting to use routing concerns for a while but finding a good way to access the resource had me stumped. This does the trick.

Hey Chris, could this approach be combined with routing concerns and so only use one controller?

Trix editor html extract, shortened for brevity.

<input type="hidden" name="article[body]" id="article_body_trix_input_article_10" value="...https://app.ptxperformance.co.uk/rails/active_storage/blobs/...<img src=&quot;https://olddomain/rails/active_storage/blobs/...<figure data-trix-attachment=&quot;{...url&amp;quot;:&amp;quot;https://olddomain/rails/active_storage/blobs/...<img src=&quot;https://olddomain/rails/active_storage/blobs/...</div>"><trix-toolbar id="trix-toolbar-1"><div class="trix-button-row">
<trix-editor class="customized-min-height" id="article_body" input="article_body_trix_input_article_10" data-direct-upload-url="https://newdomain/rails/active_storage/direct_uploads" data-blob-url-template="https://newdomain/rails/active_storage/blobs/redirect/:signed_id/:filename" ... data-trix-attachment="{&quot;contentType&quot;:&quot;image/png&quot;,&quot;filename&quot;:&quot;image.png&quot;,&quot;filesize&quot;:218212,&quot;height&quot;:1338,&quot;previewable&quot;:true,&quot;sgid&quot;:&quot;BAh7CEkiCGdpZAY6BkVUSSIwZ2lkOi8vcHR4L0FjdGl2ZVN0b3JhZ2U6OkJsb2IvNzY_ZXhwaXJlc19pbgY7AFRJIgxwdXJwb3NlBjsAVEkiD2F0dGFjaGFibGUGOwBUSSIPZXhwaXJlc19hdAY7AFQw--cce3d784b414afc965a7c8b033de543ac2d66258&quot;,&quot;url&quot;:&quot;https://olddomain/rails/active_storage/blobs/.../image.png&quot;,&quot;width&quot;:750}" data-trix-content-type="image/png" data-trix-id="83" data-trix-attributes="{&quot;caption&quot;:&quot;View Instructions menu&quot;,&quot;presentation&quot;:&quot;gallery&quot;}" class="attachment attachment--preview attachment--png" data-trix-mutable="true"><img src="https://olddomain/rails/active_storage/blobs/.../image.png" data-trix-mutable="true" width="750" height="1338"...

Hi All,

We recently moved domains and have noticed an issue with how ActionText attachments are displayed in the Trix editor. They display correctly in the show view, just not in the editor.

Article has_rich_text :body

On inspection we see that the body html still references the old domain which then becomes the src for the Trix editor img tag.

On the show view while the action-text-attachment url is still pointing to the old domain, the img src value points to the new one.

Any ideas why it works in show but not in the editor?

Thanks

Hi Chris, great series. Are you planning on revising the DM episode? Or is the implementation pretty similar to the previous one?