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. Note: Pass any additional arguments by prefixing them
  • 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.
  • colorField() — Builds and returns a string containing a color picker form control based on the supplied objectName and property.
  • colorFieldTag() — Builds and returns a string containing a color picker 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.
  • dateField() — Builds and returns a string containing a date field form control based on the supplied objectName and property.
  • dateFieldTag() — Builds and returns a string containing a date field form control based on the supplied name.
  • 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
  • emailField() — Builds and returns a string containing an email field form control based on the supplied objectName and property.
  • emailFieldTag() — Builds and returns a string containing an email field form control based on the supplied name.
  • 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.
  • firstPageLink() — Creates a link to the first page, or a disabled span when already on the first page.
  • flashMessages() — Displays a marked-up listing of messages that exist in the Flash.
  • h() — Encodes a value for safe HTML output. Use in templates to prevent XSS:
  • 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.
  • hAttr() — Encodes a value for safe use inside an HTML attribute.
  • 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.
  • lastPageLink() — Creates a link to the last page, or a disabled span when already on the last page.
  • 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
  • nextPageLink() — Creates a link to the next page, or a disabled span when on the last page.
  • numberField() — Builds and returns a string containing a number field form control based on the supplied objectName and property.
  • numberFieldTag() — Builds and returns a string containing a number field form control based on the supplied name.
  • pageNumberLinks() — Creates a windowed set of page number links around the current page.
  • paginationInfo() — Displays a text summary of the current pagination state, e.g. “Showing 26-50 of 1,000 records”.
  • paginationLinks() — Builds and returns a string containing links to pages based on a paginated query.
  • paginationNav() — Creates a complete pagination navigation element wrapping individual pagination helpers.
  • 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.
  • previousPageLink() — Creates a link to the previous page, or a disabled span when on the first page.
  • 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.
  • rangeField() — Builds and returns a string containing a range slider form control based on the supplied objectName and property.
  • rangeFieldTag() — Builds and returns a string containing a range slider 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.
  • searchField() — Builds and returns a string containing a search field form control based on the supplied objectName and property.
  • searchFieldTag() — Builds and returns a string containing a search field form control based on the supplied name.
  • 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.
  • telField() — Builds and returns a string containing a telephone field form control based on the supplied objectName and property.
  • telFieldTag() — Builds and returns a string containing a telephone field form control based on the supplied name.
  • 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
  • urlField() — Builds and returns a string containing a URL field form control based on the supplied objectName and property.
  • urlFieldTag() — Builds and returns a string containing a URL field form control based on the supplied name.
  • viteAsset() — Returns the resolved URL for a Vite entrypoint. In production, reads the Vite manifest
  • vitePreloadTag() — Returns tags for a Vite entrypoint and its transitive
  • viteScriptTag() — Returns ‘script’ tags for a Vite JS entrypoint. In development, also injects the Vite
  • viteStyleTag() — Returns a tag for a Vite CSS entrypoint. In development, Vite injects CSS via
  • yearSelectTag() — Builds and returns a string containing a select form control for a range of years based on the supplied nam