Skip to content

View Helpers

View Helpers

  • authenticityTokenField() — Generates a hidden form field that contains a CSRF authenticity token. This token is required for verifying that POST, P
  • autoLink() — Scans a block of text for URLs and/or email addresses and automatically converts them into clickable links. This helper
  • buttonTag() — Builds and returns a string containing a button form control for use in your HTML forms. Use this helper to create butto
  • buttonTo() — Creates a form containing a single button that submits to a URL. The URL is constructed the same way as linkTo(). This h
  • 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() — contentFor() is used to store a section’s output in a layout. It allows you to define content in your view templates and
  • contentForLayout() — contentForLayout() is used to render the main content of the current view inside a layout. In Wheels, when a controller
  • csrfMetaTags() — The csrfMetaTags() helper generates meta tags containing your application’s CSRF authenticity token. This is useful for
  • cycle() — cycle() is a view helper used to loop through a list of values sequentially, returning the next value each time it’s cal
  • dateSelect() — Builds and returns a string containing three select form controls for month, day, and year based on the sup
  • dateSelectTags() — dateSelectTags() is similar to dateSelect(), but instead of binding to a model object, it works directly with a name and
  • 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. It’s typically used in conjunction with startF
  • 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() — The flashMessages() function generates a formatted HTML output of messages stored in the Flash scope. It is typically us
  • hasManyCheckBox() — The hasManyCheckBox() helper generates the correct form elements for managing a hasMany or many-to-many association. It
  • hasManyRadioButton() — This helper generates radio buttons for managing a hasMany or one-to-many association, where you want the user to pick o
  • hiddenField() — The hiddenField() function generates a hidden <input type=“hidden”> tag for a given model object and property. It’
  • hiddenFieldTag() — Generates a hidden <input type=“hidden”> tag using a plain name/value pair. Unlike hiddenField(), this helper does
  • highlight() — Searches the given text for one or more phrases and wraps all matches in an HTML tag (default: <span>). This is us
  • hourSelectTag() — Builds and returns a <select> form control for choosing an hour of the day. By default, hours are shown in 24-hour
  • imageTag() — Returns an img tag.
  • includeContent() — Outputs the content for a specific section in a layout. Works together with contentFor() to define and then inject conte
  • 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. Typically used when a child layout wants to include a parent layout, or to
  • includePartial() — Includes the specified partial file in the view.
  • javaScriptIncludeTag() — Generates <script> tags for including JavaScript files. Can handle local files in the javascripts folder or extern
  • 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 <select> dropdown for the minutes of an hour (0–59). You can customize the selected value, in
  • monthSelectTag() — Generates a <select> dropdown for selecting a month. You can customize its options, labels, and display format. Un
  • 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() — Generates an HTML radio button for a form, based on a model object’s property. It can handle simple properties as well a
  • radioButtonTag() — Generates a standard HTML <input type=“radio”> element based on the supplied name and value. Unlike radioButton(),
  • resetCycle() — Rsets a named cycle, allowing it to start from the first value the next time it is called. In Wheels, cycle() is often u
  • secondSelectTag() — Generates an HTML <select> form control populated with seconds (0–59) for a minute. You can bind it to a form para
  • select() — Builds and returns an HTML <select> element bound to a model object property. It automatically handles nested asso
  • selectTag() — Builds an HTML <select> element using a name and a set of options. Unlike select(), it does not require a model ob
  • simpleFormat() — Takes plain text and converts newline and carriage return characters into HTML <br> and <p&g
  • startFormTag() — Builds and returns an opening <form> tag. The form’s action URL is automatically generated following the same rule
  • stripLinks() — Removes all <a> tags (hyperlinks) from an HTML string while preserving the inner text. This is useful when you wan
  • stripTags() — Removes all HTML tags from a string, leaving only the raw text content. Use this when you need to sanitize HTML by compl
  • styleSheetLinkTag() — Generates one or more <link> tags for including CSS stylesheets in your application. By default, it looks in the <
  • submitTag() — Builds and returns a string containing a submit button form control.
  • textArea() — Builds and returns an HTML <textarea> form control for a given model object and property. It is commo
  • textAreaTag() — Builds and returns an HTML <textarea> form control based only on the supplied field name, rather than
  • textField() — Builds and returns an HTML text field form control that is bound to a model object and one of its properties. By default
  • textFieldTag() — Builds and returns a string containing a text field form control based on the supplied name.
  • timeSelect() — Builds and returns three select form controls for hours, minutes, and seconds, based on the supplied object name and pro
  • timeSelectTags() — Builds and returns three <select> form controls for hours, minutes, and seconds based on the supplied
  • yearSelectTag() — Builds and returns a string containing a select form control for a range of years based on the supplied nam