money - format a number to a dollar value

  1. precision - Precision of dollar value. Defaults to 0.
{{ 75 | money }} = $75
{{ 75 | money: 2 }} = $75.00

json - converts data to json format

{{ some_value | json }}

textilize - formats text to html using textile markup

  1. wrap - Wrap text with paragraphs. true/false. Defaults to true.
{{ "test *string*" | textilize }} = <p>test <strong>string</strong></p>
{{ "test *string*" | textilize: false }} = test <strong>string</strong>

url_encode - encodes a value for a url

{{ "test space" | url_encode }} = test+space

url_decode - decodes a value from a url

{{ "test+space" | url_decode }} = test space

script_tag - converts text to a javascript include tag (works the same as rails javascript_include_tag)

{{ "test.js" | script_tag }}

stylesheet_tag - converts text to a stylesheet link tag (works the same as rails stylesheet_link_tag)

{{ "test.css" | stylesheet_tag }}

link_to - converts a url to an anchor tag.

  1. text - Link text. Defaults to the link url.
{{ "www.google.com" | link_to }} = <a href="www.google.com">www.google.com</a>
{{ "www.google.com" | link_to: Google }} = <a href="www.google.com">Google</a>

image_tag - converts a url to an img tag.

  1. title - Title for the image tag.
  2. size - Size as a "50x60" (width x height) formatted string.
{{ "img.jpg" | image_tag }} = <img src="img.jpg" />
{{ "img.jpg" | image_tag: "An Image" }} = <img src="img.jpg" title="An Image" />
{{ "img.jpg" | image_tag: "An Image", "50x60" }} = <img src="img.jpg" title="An Image" width="50" height="60" />
{{ "img.jpg" | image_tag: nil, "50x60" }} = <img src="img.jpg" width="50" height="60" />

assign_to - assigns the filter results to a variable.

Assigns the paginated collection to the variable data.

{{ collection | paginate_collection: 10, 1 | assign_to: 'data' }}
{% for item in data %}
  ...
{% endfor %}

paginate_links - use to paginate new and used vehicles

Uses a page parameter from the url (if set) to determine what page of the pagination to display. Ie. /vehicles?page=3

  1. anchor - apply an #anchor to all generated urls in the pagination
  2. prev_label - label for the previous page button
  3. next_label - label for the next page button
{{ vehicles | paginate }}
{{ vehicles | paginate : "anchor", "Previous vehicles", "Next Vehicles" }}

paginate_collection - use to paginate any collection of data

  1. limit - the number of items to retrieve
  2. page - the page of data to retrieve

Retrieves 10 items from the collection at a time. The 1st to 10th items for the 1st call and the 11th to 20th items for the 2nd call.

{{ collection | paginate_collection: 10, 1 }}
{{ collection | paginate_collection: 10, 2 }}

An additional variable called paginate is automatically assigned when calling this method. It contains the following pagination details:

{{ paginate.total_pages }}
{{ paginate.next_page }}

page_url - converts a text value representing a CMS page name to its corresponding url.

If a page has been created called "test", its associated url is output.

{{ "test" | page_url }} = /path/to/page

asset_url - converts a text value representing a CMS asset name to its corresponding url.

If an asset has been created called "test", its associated path is output.

{{ "test" | asset_url }} = /public/assets/5/original/test.jpg

component_url - converts a text value representing a component path to its corresponding url.

{{ "jquery.plugin-1.0/javascript/jquery.plugin-1.0.js" | component_url }} = /components/1/jquery.plugin-1.0/javascript/jquery.plugin-1.0.js