method

textarea_tag

Importance_2
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActionView::Helpers::FormTagHelper
  • 1.0.0
  • 1.1.6
  • 1.2.6
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.8
  • 3.0.0
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • 4.1.8
  • 4.2.1
  • 4.2.7
  • 4.2.9
  • 5.0.0.1
  • 5.1.7
  • 5.2.3
  • 6.0.0
  • 6.1.3.1
  • 6.1.7.7
  • 7.0.0
  • 7.1.3.2
  • 7.1.3.4
  • 7.2.3
  • 8.0.0 (0)
  • 8.1.1 (0)
  • What's this?

Method not available on this version

This method is only available on newer versions. The first available version of the method is shown here.

textarea_tag(name, content = nil, options = {}) public

Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.

Options

  • :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., “25x10”).

  • :rows - Specify the number of rows in the textarea

  • :cols - Specify the number of columns in the textarea

  • :disabled - If set to true, the user will not be able to use this input.

  • :escape - By default, the contents of the text input are HTML escaped. If you need unescaped contents, set this to false.

  • Any other key creates standard HTML attributes for the tag.

Examples

textarea_tag 'post'
# => <textarea id="post" name="post"></textarea>

textarea_tag 'bio', @user.bio
# => <textarea id="bio" name="bio">This is my biography.</textarea>

textarea_tag 'body', nil, rows: 10, cols: 25
# => <textarea cols="25" id="body" name="body" rows="10"></textarea>

textarea_tag 'body', nil, size: "25x10"
# => <textarea name="body" id="body" cols="25" rows="10"></textarea>

textarea_tag 'description', "Description goes here.", disabled: true
# => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>

textarea_tag 'comment', nil, class: 'comment_input'
# => <textarea class="comment_input" id="comment" name="comment"></textarea>
Show source
Register or log in to add new notes.