<div dir="ltr">Hi everyone,<div><br></div><div>This may be a little long, please bear with me.</div><div><br></div><div>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.</div><div><br></div><div>This is the editor:</div><div><a href="https://github.com/michelson/Dante">https://github.com/michelson/Dante</a></div><div><br></div><div>This is the demo in action:</div><div><a href="http://michelson.github.io/Dante/">http://michelson.github.io/Dante/</a></div><div><br></div><div>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.</div><div><br></div><div>This is a link to my repo:</div><div><a href="https://github.com/piratebroadcast/bckpckrs/">https://github.com/piratebroadcast/bckpckrs/</a><br></div><div><br></div><div>The integration of the editor is on this page:</div><div><a href="https://github.com/piratebroadcast/bckpckrs/blob/master/app/views/stories/new.html.erb">https://github.com/piratebroadcast/bckpckrs/blob/master/app/views/stories/new.html.erb</a><br></div><div><br></div><div>The only reference anywhere online I've found is *me* trying to figure out how to integrate this thing almost a year ago:</div><div><a href="http://stackoverflow.com/questions/33656321/integrating-dante-ysiwyg-medium-style-editor-into-a-rails-form">http://stackoverflow.com/questions/33656321/integrating-dante-ysiwyg-medium-style-editor-into-a-rails-form</a><br></div><div><br></div><div>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.</div><div><br></div><div><pre style="font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;border-radius:3px;color:rgb(51,51,51);background-color:rgb(247,247,247)"><span class="" style=""><<span class="" style="color:rgb(99,163,92)">script</span> <span class="" style="color:rgb(121,93,163)">type</span>=<span class="" style="color:rgb(24,54,145)"><span class="" style="">"</span>text/javascript<span class="" style="">"</span></span>></span>
<span class="" style="">    editor <span class="" style="color:rgb(167,29,93)">=</span> <span class="" style="color:rgb(167,29,93)">new</span> <span class="" style="color:rgb(121,93,163)">Dante.Editor</span>(</span>
<span class="" style="">      {</span>
<span class="" style="">        el<span class="" style="color:rgb(167,29,93)">:</span> <span class="" style="color:rgb(24,54,145)"><span class="" style="">"</span>#editor<span class="" style="">"</span></span>,</span>
<span class="" style="">        upload_url<span class="" style="color:rgb(167,29,93)">:</span> <span class="" style="color:rgb(24,54,145)"><span class="" style="">"</span>/images.json<span class="" style="">"</span></span>, <span class="" style="color:rgb(150,152,150)">//it expect an url string in response like /your/server/image.jpg or <a href="http://app.com/images/image.jpg">http://app.com/images/image.jpg</a></span></span>
<span class="" style="">        store_url<span class="" style="color:rgb(167,29,93)">:</span> <span class="" style="color:rgb(24,54,145)"><span class="" style="">"</span>/save<span class="" style="">"</span></span> <span class="" style="color:rgb(150,152,150)">//post to save</span></span>
<span class="" style=""></span>
<span class="" style="">      }</span>
<span class="" style="">    );</span>
<span class="" style="">    <span class="" style="">editor</span>.<span class="" style="color:rgb(0,134,179)">start</span>()</span>
<span class="" style="">  </<span class="" style="color:rgb(99,163,92)">script</span>></span></pre></div><div><br></div><div><br></div><div>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? </div><div><br></div><div>Any and all tips would really be appreciated.</div><div><br></div><div>Thank you!</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Jesse Waites</div><div>Web Developer</div><div><a href="http://JesseWaites.com" target="_blank">JesseWaites.com</a></div></div></div></div></div></div></div></div>
</div></div>