Module: RedCloth::Rails::Helpers::FormTagHelper
- Defined in:
- lib/redcloth-rails/helpers/form_tag_helper.rb
Instance Method Summary collapse
-
#textile_editor_tag(name, content = nil, options = {}) ⇒ Object
Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions and includes the textile toolbar above it.
Instance Method Details
#textile_editor_tag(name, content = nil, options = {}) ⇒ Object
Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions and includes the textile toolbar above it.
Any other option (key/value pair) will be used to create HTML attributes for the tag.
Samples:
textile_editor_tag 'post'
# => <textarea id="post" name="post"></textarea>
textile_editor_tag 'bio', @user.bio
# => <textarea id="bio" name="bio">This is my biography.</textarea>
textile_editor_tag 'body', nil, :rows => 10, :cols => 25
# => <textarea cols="25" id="body" name="body" rows="10"></textarea>
textile_editor_tag 'body', nil, :size => "25x10"
# => <textarea name="body" id="body" cols="25" rows="10"></textarea>
textile_editor_tag 'description', "Description goes here.", :disabled => true
# => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
textile_editor_tag 'comment', nil, :class => 'comment_input'
# => <textarea class="comment_input" id="comment" name="comment"></textarea>
38 39 40 41 42 43 44 |
# File 'lib/redcloth-rails/helpers/form_tag_helper.rb', line 38 def textile_editor_tag(name, content = nil, = {}) editor_id = [:id] || name mode = .delete(:simple) ? 'simple' : 'extended' (@textile_editor_ids ||= []) << [editor_id.to_s, mode.to_s] text_area_tag(name, content, ) end |