-
Notifications
You must be signed in to change notification settings - Fork 2
View helpers
Endel Dreyer edited this page Aug 27, 2014
·
1 revision
Helper | Template | Output |
---|---|---|
str_plural | {{ str_plural "hook" }} |
hooks |
str_singular | {{ str_singular "hooks" }} |
hook |
uppercase | {{ uppercase "hook" }} |
HOOK |
lowercase | {{ lowercase "HOOK-Platform" }} |
hook-platform |
camel_case | {{ camel_case "hook_platform" }} |
hookPlatform |
snake_case | {{ snake_case "HookPlatform" }} |
hook_platform |
Generate a HTML link to the given URL.
{{ link_to "about" "About page" class="featured" }}
Generate HTML input tag.
{{ input "username" placeholder="Username" class="inline" }}
Generate HTML select tag.
{{ select "country" options=countries }}
Generate HTML form tag.
{{#form method="post"}}
{{ input "username" }}
{{ input "password" type="password" }}
{{/form}}
Same as form
. Plus generated field names will have a namespace. Example: <input name="item[name]" />
{{#form_for "item"}}
{{ input "name" }}
{{ input type="submit" value="Create!" }}
{{/form}}
Count number of items in array.
{{ count items }}
Generate pagination links.
{{#items}}
<p>{{ name }}</p>
{{/items}}
{{ paginate items }}