form_tag($url, $attributes=null)

Creates a form opening tag.


  • multipart - sets enctype to multipart/form-data;

If method is different from GET or POST, a hidden _method field will be added.

label_tag($name, $text=null, $attributes=null)

Renders a form label.

hidden_field_tag($name, $value=null, $attributes=null)

Renders a hidden form field.

text_field_tag($name, $value=null, $attributes=null)

Renders a text form field.

text_area_tag($name, $content=null, $attributes=null)

Renders a text form area.

password_field_tag($name, $value=null, $attributes=null)

Renders a password form field.

file_field_tag($name, $attributes=null)

Renders a file upload form field.

check_box_tag($name, $value=1, $attributes=null)

Renders a check box.

radio_button_tag($name, $value, $attributes=null)

Renders a radio button.

options_for_select($options, $selected=null)

Parses options for a select option field.

Render from a hash:

$options = array(
  'Keyboard' => 45,
  'Mouse'    => 72,
  'Scanner'  => 59,
$html_options = options_for_select($options, 45); 

Render from an ActiveRecord resultset:

$products = $post->find(':values', array('select' => 'id,name'));
$html_options = options_for_select($products, 59); 

select_tag($name, $options=null, $attributes=null)

Renders a select option field.

$options must be a string of OPTION tags. You may use options_for_select to build it.


$options = array(
  'Keyboard' => 45,
  'Mouse'    => 72,
  'Scanner'  => 59,
$selected = 45;
select_tag('type', options_for_select($options, $selected)); 

submit_tag($value=null, $name=null, $attributes=null)

Renders a submit button.