Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking a basic SO-like WYSIWYG editor in Rails
    primarykey
    data
    text
    <p>I am relatively new to Rails, having recently completed Hartl's Rails Tutorial, and am now embarking on my first full fledged project. What I am interested in adding to my web app is something similar to the text input feature in SO, where you could type, and see directly how your text will turn out. After <a href="http://epochwolf.com/blog/2010/01/18/using-bluecloth-20/" rel="nofollow noreferrer">some</a> <a href="https://stackoverflow.com/questions/3578825/rendering-markdown-text-in-rails-3">digging</a> <a href="https://stackoverflow.com/questions/3602040/bluecloth-isnt-working-with-rails-3">around</a> on SO, I have decided on using the gem <code>bluecloth</code>, which is Markdown implemented in Ruby, but now have the following questions:</p> <ol> <li>I am unsure about how to tie what <code>bluecloth</code> outputs to the <code>form_for</code> helper. My understanding was that you could convert to strings via the function <code>html = BlueCloth.new(str).to_html()</code>, but I am unsure what to do when you have a text field as part of <code>form_for</code>, where I should plug in the bluecloth part? In other words, I am still a bit confused about the magic of typing in one box and seeing the item show elsewhere on the page.</li> <li>Are the WMD bar button items and functions included Markdown editors (such as bluecloth), or would this be something I have to build manually? If so, how would I get something like the <strong>bold</strong> button to show "** **" in the editor as you type?</li> </ol> <p>Thanks for your help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload