redcloth-rails

rails 3 engine which enables RedCloth and provides helpers for the awesome TextileEditor.


License
MIT
Install
gem install redcloth-rails -v 0.2.0

Documentation

redcloth-rails

Homepage: Github
Author: emjot GmbH & Co. KG

The redcloth-rails gem enables RedCloth for rails (>= 3.1).
It provides helpers to integrate the TextileEditor toolbar.

History

The TextileEditor was created by Dave Olsen (Javascript) and Chris Scharf (Ruby/Rails) of West Virginia University Web Services .
The rails 3.0 support and gemification was realized by ryanfelton (https://github.com/ryanfelton/textile-editor-helper).

Dependencies

  • RedCloth (>= 4.2)
  • rails (>= 3.1)
  • sass-rails
  • coffee-rails
  • jquery

Installation (via Bundler)

Gemfile:
gem "redcloth-rails"

Setup

Generate a config file

rails g textile_editor_config

Include the coffeescript and scss files in your asset manifests

app/assets/javascripts/application.js:
(...)
//= require textile-editor
//= require ./textile-editor-config
app/assets/stylesheets/application.css:
(...)
*= require textile-editor

Usage

Enable the TextileEditor for your attributes in your form view:

<%= form_for(@post) do |f| %>
  (...)
  <%= f.textile_editor :content %>
  (...)
<% end %>

(Or, to generate the input field without the form builder:)

<%= textile_editor :post, :content %>

Initialize the TextileEditor afterwards via:

<%= textile_editor_initialize %>

Rendering Textile

Please refer to RedCloth.
If you use haml you may want to look at the haml-contrib gem, which provides a :textile filter.

Links

redcloth.org
textile_editor_helper
textile_editor_helper
more info on textile

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request