Forum: Ruby on Rails wysihtml5 for rails

Posted by Dave Castellano (dcastellano1)
on 2013-01-23 15:24
Does anybody have experience with wysihtml5 for rails?  I have installed
the WYSIWYG editor and it is working fine, but I'm not sure how to
manipulate any of its characteristics.  I want to hide the buttons on
some occasions and more importantly need to set it to a read only mode
on a particular page so users can click on URL's in the WYSIWYG text
area.

My current setup...
gem 'wysihtml5-rails'  in gemfile
(https://github.com/NARKOZ/wysihtml5-rails.git)

In "show' page...

<%= text_area_tag  id="ck_a", @formatted_question[:anno_a],
:class=>'wysihtml5' %>

               <script type="text/javascript">
      $('.wysihtml5').each(function(i, elem) {
        $(elem).wysihtml5();
      });
    </script>

Also, not sure why but only works when <script
type="text/javascript">...</script>
is below the text_area_tag in the body of the page.

I'm half way through Heads UP Javascript book to give you an idea of my
level of programming ability, so thanks for the help!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.