80beans / wysihat-engine

A Rails engine to help integrate the 37signals WysiHat rich text editor to your application.

Home | Edit | New

Examples

When you add the WysiHat Editor to your form without giving any extra options:

<% form_for(@page) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :content %><br />
    <%= f.wysihat_editor :content %>
  </p>
  <p>
    <%= f.submit 'Create' %>
  </p>
<% end %>

You’ll get the standard button set with the buttons :bold, :italic, :underline, :strikethrough, :justify_left, :justify_center, :justify_right, :insert_ordered_list, :insert_unordered_list, :undo, :redo, :link, :html and :image.

If you don’t want that, you can use the :buttons option to add only the ones you want, like this:

  <% form_for(@page) do |f| %>
    <%= f.error_messages %>
    <p>
      <%= f.label :content %><br />
      <%= f.wysihat_editor :content, :buttons => [:bold, :italic, :underline] %>
    </p>
    <p>
      <%= f.submit 'Create' %>
    </p>
  <% end %>
Last edited by jeffkreeftmeijer, Sun Oct 11 15:23:54 -0700 2009
Home | Edit | New
Versions: