Skip to content

View Helpers

View Helpers

  • authenticityTokenField() — Returns a hidden form field containing a new authenticity token.
  • autoLink() — Turns all URLs and email addresses into links.
  • buttonTag() — Builds and returns a string containing a button form control.
  • buttonTo() — Creates a form containing a single button that submits to the URL.
  • checkBox() — Builds and returns a string containing a check box form control based on the supplied name.
  • checkBoxTag() — Builds and returns a string containing a check box form control based on the supplied name.
  • contentFor() — Used to store a section’s output for rendering within a layout.
  • contentForLayout() — Includes content for the body section, which equates to the output generated by the view template run by the request.
  • csrfMetaTags() — Include this in your layouts’ head sections to include meta tags containing the authenticity token for use
  • cycle() — Cycles through list values every time it is called.
  • dateSelect() — Builds and returns a string containing three select form controls for month, day, and year based on the sup
  • dateSelectTags() — Builds and returns a string containing three select form controls (month, day, and year) based on a name an
  • dateTimeSelect() — Builds and returns a string containing six select form controls (three for date selection and the remaining
  • dateTimeSelectTags() — Builds and returns a string containing six select form controls (three for date selection and the remaining
  • daySelectTag() — Builds and returns a string containing a select form control for the days of the week based on the supplied
  • endFormTag() — Builds and returns a string containing the closing form tag.
  • errorMessageOn() — Returns the error message, if one exists, on the object’s property.
  • errorMessagesFor() — Builds and returns a list (ul tag with a default class of error-messages) contain
  • fileField() — Builds and returns a string containing a file field form control based on the supplied objectName and property.
  • fileFieldTag() — Builds and returns a string containing a file form control based on the supplied name.
  • flashMessages() — Displays a marked-up listing of messages that exist in the Flash.
  • hasManyCheckBox() — Used as a shortcut to output the proper form elements for an association.
  • hasManyRadioButton() — Used as a shortcut to output the proper form elements for an association.
  • hiddenField() — Builds and returns a string containing a hidden field form control based on the supplied objectName and property.
  • hiddenFieldTag() — Builds and returns a string containing a hidden field form control based on the supplied name.
  • highlight() — Highlights the phrase(s) everywhere in the text if found by wrapping them in span tags.
  • hourSelectTag() — Builds and returns a string containing one select form control for the hours of the day based on the suppli
  • imageTag() — Returns an img tag.
  • includeContent() — Used to output the content for a particular section in a layout.
  • includedInObject() — Used as a shortcut to check if the specified IDs are a part of the main form object.
  • includeLayout() — Includes the contents of another layout file.
  • includePartial() — Includes the specified partial file in the view.
  • javaScriptIncludeTag() — Returns a script tag for a JavaScript file (or several) based on the supplied arguments.
  • linkTo() — Creates a link to another page in your application.
  • mailTo() — Creates a mailto link tag to the specified email address, which is also used as the name of the link unless
  • minuteSelectTag() — Builds and returns a string containing one select form control for the minutes of an hour based on the supp
  • monthSelectTag() — Builds and returns a string containing a select form control for the months of the year based on the suppli
  • paginationLinks() — Builds and returns a string containing links to pages based on a paginated query.
  • passwordField() — Builds and returns a string containing a password field form control based on the supplied objectName and property.
  • passwordFieldTag() — Builds and returns a string containing a password field form control based on the supplied name.
  • radioButton() — Builds and returns a string containing a radio button form control based on the supplied objectName and property.
  • radioButtonTag() — Builds and returns a string containing a radio button form control based on the supplied name.
  • resetCycle() — Resets a cycle so that it starts from the first list value the next time it is called.
  • secondSelectTag() — Builds and returns a string containing one select form control for the seconds of a minute based on the sup
  • select() — Builds and returns a string containing a select form control based on the supplied objectName and property.
  • selectTag() — Builds and returns a string containing a select form control based on the supplied name and options.
  • simpleFormat() — Returns formatted text using HTML break tags (
    ) and HTML paragraph elements (

    ) base
  • startFormTag() — Builds and returns a string containing the opening form tag.
  • stripLinks() — Removes all links from an HTML string, leaving just the link text.
  • stripTags() — Removes all HTML tags from a string.
  • styleSheetLinkTag() — Returns a link tag for a stylesheet (or several) based on the supplied arguments.
  • submitTag() — Builds and returns a string containing a submit button form control.
  • textArea() — Builds and returns a string containing a text area field form control based on the supplied objectName and property.
  • textAreaTag() — Builds and returns a string containing a text area form control based on the supplied name.
  • textField() — Builds and returns a string containing a text field form control based on the supplied objectName and property.
  • textFieldTag() — Builds and returns a string containing a text field form control based on the supplied name.
  • timeSelect() — Builds and returns a string containing three select form controls for hour, minute, and second based on the
  • timeSelectTags() — Builds and returns a string containing three select form controls for hour, minute, and second based on nam
  • yearSelectTag() — Builds and returns a string containing a select form control for a range of years based on the supplied nam