The form_tag module is accessible via the webhelpers.rails module.
Starts a form tag that points the action to an url.
The url options should be given either as a string, or as a url() function. The method for the form defaults to POST.
Options:
Starts a form tag that points the action to an url.
The url options should be given either as a string, or as a url() function. The method for the form defaults to POST.
Options:
Creates a dropdown selection box
option_tags is a string containing the option tags for the select box:
>>> select("people", "<option>George</option>")
'<select id="people" name="people"><option>George</option></select>'
Options:
Creates a standard text field.
value is a string, the content of the text field
Options:
Remaining keyword options will be standard HTML options for the tag.
Creates a hidden field.
Takes the same options as text_field
Creates a file upload field.
If you are using file uploads then you will also need to set the multipart option for the form.
Example:
>>> file_field('myfile')
'<input id="myfile" name="myfile" type="file" />'
Creates a password field
Takes the same options as text_field
Creates a text input area.
Options:
Example:
>>> text_area("body", '', size="25x10")
'<textarea cols="25" id="body" name="body" rows="10"></textarea>'
Creates a radio button.
The id of the radio button will be set to the name + value with a _ in between to ensure its uniqueness.
Creates a submit button with the text value as the caption.
Options:
See the source for more information.