View Helpers
View Helpers
authenticityTokenField()— Generates a hidden form field that contains a CSRF authenticity token. This token is required for verifying that POST, PautoLink()— Scans a block of text for URLs and/or email addresses and automatically converts them into clickable links. This helperbuttonTag()— Builds and returns a string containing a button form control for use in your HTML forms. Use this helper to create buttobuttonTo()— Creates a form containing a single button that submits to a URL. The URL is constructed the same way as linkTo(). This hcheckBox()— 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 andcontentForLayout()— contentForLayout() is used to render the main content of the current view inside a layout. In Wheels, when a controllercsrfMetaTags()— The csrfMetaTags() helper generates meta tags containing your application’s CSRF authenticity token. This is useful forcycle()— cycle() is a view helper used to loop through a list of values sequentially, returning the next value each time it’s caldateSelect()— Builds and returns a string containing threeselectform controls for month, day, and year based on the supdateSelectTags()— dateSelectTags() is similar to dateSelect(), but instead of binding to a model object, it works directly with a name anddateTimeSelect()— 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. It’s typically used in conjunction with startFerrorMessageOn()— 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()— The flashMessages() function generates a formatted HTML output of messages stored in the Flash scope. It is typically ushasManyCheckBox()— The hasManyCheckBox() helper generates the correct form elements for managing a hasMany or many-to-many association. IthasManyRadioButton()— This helper generates radio buttons for managing a hasMany or one-to-many association, where you want the user to pick ohiddenField()— 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 doeshighlight()— Searches the given text for one or more phrases and wraps all matches in an HTML tag (default: <span>). This is ushourSelectTag()— Builds and returns a <select> form control for choosing an hour of the day. By default, hours are shown in 24-hourimageTag()— Returns animgtag.includeContent()— Outputs the content for a specific section in a layout. Works together with contentFor() to define and then inject conteincludedInObject()— 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 toincludePartial()— 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 externlinkTo()— 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 <select> dropdown for the minutes of an hour (0–59). You can customize the selected value, inmonthSelectTag()— Generates a <select> dropdown for selecting a month. You can customize its options, labels, and display format. UnpaginationLinks()— 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 aradioButtonTag()— 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 usecondSelectTag()— Generates an HTML <select> form control populated with seconds (0–59) for a minute. You can bind it to a form paraselect()— Builds and returns an HTML <select> element bound to a model object property. It automatically handles nested assoselectTag()— Builds an HTML <select> element using a name and a set of options. Unlike select(), it does not require a model obsimpleFormat()— Takes plain text and converts newline and carriage return characters into HTML<br>and<p&gstartFormTag()— Builds and returns an opening <form> tag. The form’s action URL is automatically generated following the same rulestripLinks()— Removes all <a> tags (hyperlinks) from an HTML string while preserving the inner text. This is useful when you wanstripTags()— Removes all HTML tags from a string, leaving only the raw text content. Use this when you need to sanitize HTML by complstyleSheetLinkTag()— 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 commotextAreaTag()— Builds and returns an HTML<textarea>form control based only on the supplied field name, rather thantextField()— Builds and returns an HTML text field form control that is bound to a model object and one of its properties. By defaulttextFieldTag()— 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 protimeSelectTags()— Builds and returns three<select>form controls for hours, minutes, and seconds based on the suppliedyearSelectTag()— Builds and returns a string containing aselectform control for a range of years based on the supplied nam