public
Description: Adds a handy toolbar to any Textile-enabled text area.
Homepage: http://terralien.com/projects/textile-toolbar/
Clone URL: git://github.com/pelargir/textile_toolbar.git
Click here to lend your support to: textile_toolbar and make a donation at www.pledgie.com !
Matthew (author)
Sat Aug 22 06:16:47 -0700 2009
commit  d3fd0930a1909a6e6dde2f8e39192d75954ac880
tree    794e5543b0474bfc508c5daf48a9d699bd43161c
parent  359a18afb991b4469f0c1e4580d69973c0711db8
textile_toolbar / README
100644 57 lines (34 sloc) 1.645 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
= textile_toolbar
 
Adds a handy Textile toolbar to any text area. The toolbar currently offers
the following functions:
 
  - Bold: select some text and click this button to make it bold.
  - Italic: select some text and click this button to make it italic.
  - Insert Hyperlink: select some text, click, enter URL, and link is inserted.
  - Insert Image: click, enter image URL, and image is inserted at cursor.
 
A link to a Textile reference page is also shown beside the toolbar.
 
== Installation
 
Install the gem directly:
 
  sudo gem install pelargir-textile_toolbar --source=http://gems.github.com
  
Or install the gem in your Rails project as a plugin:
  
  script/plugin install git://github.com/pelargir/textile_toolbar.git
 
Or clone the project:
 
  git clone git://github.com/pelargir/textile_toolbar.git
 
Then copy the required image and JS files into your Rails project
 
  rake textile_toolbar:install
 
== Usage
 
Use the textile_area helper where you would normally use the text_area
helper. Yep, it's that simple!
 
  <%= text_area :article, :body %> # plain old text area
  <%= textile_area :article, :body %> # text area with Textile toolbar
 
Form blocks are supported, letting you do this also:
 
  <% form_for :article do |f| -%>
    <%= f.textile_area :body %>
  <% end -%>
 
Any options that can be passed to text_area can also be passed to textile_area.
For example, to set the width and height:
 
  <%= textile_area :article, :body, :rows => 5, :cols => 10 %>
 
== Resources
 
Repository: http://github.com/pelargir/textile_toolbar/
Blog: http://matthewbass.com
Author: Matthew Bass
 
Extraction work sponsored by Terralien