Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Make it configurable just for backend development #43

Closed
fedeagripa opened this issue Nov 30, 2018 · 3 comments
Closed

Make it configurable just for backend development #43

fedeagripa opened this issue Nov 30, 2018 · 3 comments

Comments

@fedeagripa
Copy link

I found this new feature really interesting for chat feature developing as it also make use of ActiveStorage.
I tried to make it work on a API case but I founded the problem that the :content received at the controller is too specific to be generated by a frontend:

<div>
 <figure data-trix-attachment=\“{&quot;contentType&quot;:&quot;image/jpeg&quot;,&quot;filename&quot;:&quot;happy_frog.jpg&quot;,&quot;filesize&quot;:91211,&quot;height&quot;:386,&quot;sgid&quot;:&quot;BAh7CEkiCGdpZAY6BkVUSSI3Z2lkOi8vYWN0aW9uLXRleHQvQWN0aXZlU3RvcmFnZTo6QmxvYi83P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--0861859ff592952a0f7d81387e24246d5816b26f&quot;,&quot;url&quot;:&quot;http://localhost:3000/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9ece563b8519d50276db4cf816538a712315615c/happy_frog.jpg&quot;,&quot;width&quot;:620}\” data-trix-content-type=\“image/jpeg\” data-trix-attributes=\“{&quot;presentation&quot;:&quot;gallery&quot;}\” class=\“attachment attachment--preview attachment--jpg\“>
   <img src=\“http://localhost:3000/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9ece563b8519d50276db4cf816538a712315615c/happy_frog.jpg\” width=\“620\” height=\“386\“>
   <figcaption class=\“attachment__caption\“>
     <span class=\“attachment__name\“>happy_frog.jpg</span>
     <span class=\“attachment__size\“>89.07 KB</span>
   </figcaption>
 </figure>
</div> 

So, is there any plan to standardize it? or maybe introduce any option to install it like `rails action_text:install --api`` ?

I would be more than happy to lend a hand or even propose a pr, but first want to hear about the community due to being a couple of different ways to solve this

@javan
Copy link
Contributor

javan commented Dec 2, 2018

APIs can accept attachment markup in canonicalized form (e.g. <action-text-attachment sgid="…"></action-text-attachment>) instead of the full Trix-compatible markup like you pasted above. This test may help illustrate. See Basecamp 3's API docs on Rich text too: https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md

@fedeagripa
Copy link
Author

APIs can accept attachment markup in canonicalized form (e.g. <action-text-attachment sgid="…"></action-text-attachment>) instead of the full Trix-compatible markup like you pasted above. This test may help illustrate. See Basecamp 3's API docs on Rich text too: https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md

This seems useful, so I would change my request to update README.md to provide this information with some example. Does that make sense?

@georgeclaghorn
Copy link
Contributor

Action Text has been merged into Rails. Please do open a PR against rails/rails if you find a way to improve the README.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants