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’headsections to include meta tags containing the authenticity token for usecycle()— Cycles through list values every time it is called.dateSelect()— Builds and returns a string containing threeselectform controls for month, day, and year based on the supdateSelectTags()— Builds and returns a string containing threeselectform controls (month, day, and year) based on a name andateTimeSelect()— Builds and returns a string containing sixselectform controls (three for date selection and the remainingdateTimeSelectTags()— Builds and returns a string containing sixselectform controls (three for date selection and the remainingdaySelectTag()— Builds and returns a string containing aselectform control for the days of the week based on the suppliedendFormTag()— Builds and returns a string containing the closingformtag.errorMessageOn()— Returns the error message, if one exists, on the object’s property.errorMessagesFor()— Builds and returns a list (ultag with a defaultclassoferror-messages) containfileField()— 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 inspantags.hourSelectTag()— Builds and returns a string containing oneselectform control for the hours of the day based on the suppliimageTag()— Returns animgtag.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 ascripttag for a JavaScript file (or several) based on the supplied arguments.linkTo()— Creates a link to another page in your application.mailTo()— Creates amailtolink tag to the specified email address, which is also used as the name of the link unlessminuteSelectTag()— Builds and returns a string containing oneselectform control for the minutes of an hour based on the suppmonthSelectTag()— Builds and returns a string containing aselectform control for the months of the year based on the supplipaginationLinks()— 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 oneselectform control for the seconds of a minute based on the supselect()— 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 () basestartFormTag()— Builds and returns a string containing the openingformtag.stripLinks()— Removes all links from an HTML string, leaving just the link text.stripTags()— Removes all HTML tags from a string.styleSheetLinkTag()— Returns alinktag 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 threeselectform controls for hour, minute, and second based on thetimeSelectTags()— Builds and returns a string containing threeselectform controls for hour, minute, and second based on namyearSelectTag()— Builds and returns a string containing aselectform control for a range of years based on the supplied nam