No description, website, or topics provided.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bundle
assets
lib
test
.gitignore
CHANGELOG
Gemfile
Gemfile.lock
MIT-LICENSE
README
Rakefile
VERSION
init.rb
install.rb
textile-editor-0.1.0.gem
textile_editor-0.1.0.gem
textile_editor.gemspec

README

= Textile Editor v0.3

Textile Editor is a gem for Ruby on Rails to add a textile toolbar to textareas


== Dependency

To use Textile Editor you must be using either the Prototype or jQuery JavaScript libraries. If using Prototype, the Textile Editor starts up on the 'dom:loaded' custom event. If using jQuery, it uses the $(document).ready() method.


== Installation

Directions to get the helper up and running for your install:

	1. run rake textile_editor_helper:install
	2. for the textarea(s) that you want to add the TEH toolbar to replace the text area tag with:

		<% form_for(:user, :url => user_path(@user), :html => { :method => :put }) do |f| %>
	  	<%= f.textile_editor :description %>
    <% end %>

		**OR**
		
		<%= form_tag :controller => "users", :action => "edit", :id => @user.id %>
			<%= textile_editor :user, "website" %>
		</form>
		
		**OR** 
		
		<%= textile_editor_tag 'description', :description -%> 
		
		**just like writing a text area tag, same options**

	3. at the end of your form put in the following code:

		<%= textile_editor_initialize -%> **Important!**
		
		If using jQuery, do textile_editor_initialize(:framework => :jquery)

	4. save your view and check it out


== Simple vs. Extended

TEH has a built-in mode to show only a sub-selection of available tags called simple. Currently the 'simple' tags are: bold, underline, italic, strikethrough. To create a text area that will only use the 'simple' tags create your text area with the following code:

	<%= textile_editor 'object', 'field', :simple -%>
	

== To modify Textile Editor

Most of the options that you might want to modify (e.g. access keystroke or whether a tag is available in simple) are found in textile_editor_config.js. Pretty straightforward.

== License

Textile Editor is released under the MIT license.


= Credits

Textile Editor is based off the Textile Editor Helper created by Dave Olsen (Javascript) and Chris Scharf