[LRUG] [Help Request] Completely stumped about integrating "Dante" WYSIWYG into my Rails app

Jesse Waites jesse.waites at gmail.com
Thu Aug 4 11:44:20 PDT 2016


Hi everyone,

This may be a little long, please bear with me.

I have a dead simple hobby rails app spun up with Devise. I have users,
users have many Stories. Those associations are done, easy peasy. I am now
trying to integrate a Medium.com style WYSIWYG editor called Dante into a
hobby app.

This is the editor:
https://github.com/michelson/Dante

This is the demo in action:
http://michelson.github.io/Dante/

I have managed to get the editor on the page, but for the life of me I
cannot seem to figure out how to get it to actually save the content.

This is a link to my repo:
https://github.com/piratebroadcast/bckpckrs/

The integration of the editor is on this page:
https://github.com/piratebroadcast/bckpckrs/blob/master/app/views/stories/new.html.erb

The only reference anywhere online I've found is *me* trying to figure out
how to integrate this thing almost a year ago:
http://stackoverflow.com/questions/33656321/integrating-dante-ysiwyg-medium-style-editor-into-a-rails-form

There, a developer answers that I should somehow integrate the content from
the editor into a simple_form form. I'm not so sure about that, as the
editor *Seems* to have an upload URL and can so it itself.

<script type="text/javascript">    editor = new Dante.Editor(      {
     el: "#editor",        upload_url: "/images.json", //it expect an
url string in response like /your/server/image.jpg or
http://app.com/images/image.jpg        store_url: "/save" //post to
save      }    );    editor.start()  </script>



I am completely baffled as to how the system would know when you are done
"writing" your story into the editor. Does it POST constantly?

Any and all tips would really be appreciated.

Thank you!



-- 
Jesse Waites
Web Developer
JesseWaites.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20160804/25efbfc6/attachment.html>


More information about the Chat mailing list