Outputs error class if argument is not empty. Example: Using error_class to show output an error class.
<input class="{{ form.errors.description | error_class }}" />
Outputs error fields inline in paragraph. Example: Using inline_errors to show errors inline.
{{ form.errors.description | inline_errors }}
Converts a supplied drop to URL parameter if possible. Example: Using to_param filter in liquid.
<h1>Signup to a service</h1>
<a href="{{ urls.signup }}?{{ service | to_param }}">Signup to {{ service.name }}</a>
Group collection by some key. Example: Group applications by service.
{% assign grouped = applications | group_by: 'service' %}
{% for group in grouped %}
Service: {{ group[0 }}
{% for app in group[1] %}
Application: {{ app.name }}
{% endfor %}
{% endfor %}
True if any string in the collection equals to the parameter. Example: Are there any pending apps of the current account?
{% assign has_pending_apps = current_account.applications | map: 'state' | any: 'live' %}
Stylesheet link
Javascript includes tag.
Outputs an tag using the parameters as its
src
attribute.
{{ 'http://example.com/cool.gif' | image_tag }}
# => <img src="http://example.com/cool.gif" >
Converts email address to a 'mailto' link.
{{ 'me@there.is' | mail_to }}
# => <a href="mailto:me@there.is">me@there.is</a>
Marks content as HTML safe so that it is not escaped.
Converts word to plural form.
Generates a button to delete a resource present on the URL. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.
To add a confirmation dialog, add a confirm attribute with a confirmation text
{{ 'Delete Message' | delete_button: message.url, class: 'my-button',
confirm: 'are you sure?' }}
Generates a button to delete a resource present on the URL using AJAX. First parameter is a URL, second is a title.
To add a confirmation dialog, add a confirm attribute with a confirmation text.
{{ 'Delete Message' | delete_button_ajax: message.url, confirm: 'are you sure?' }}
Generates a button to 'update' (HTTP PUT request) a resource present on the URL. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.
To change the text of the submit button on submit, add a disable_with attribute with a the new button text.
{{ 'Resend' | update_button: message.url, class: 'my-button', disable_with: 'Resending…' }}
Generates a button to 'update' (HTTP PUT request) a resource present on the URL using AJAX. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.
To change the button text on submit, add a disable_with attribute with a the new button text.
{{ 'Resend' | update_button: message.url, class: 'my-button', disable_with: 'Resending…' }}
Generates a button to create a resource present on the URL. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.
To change the button text on submit, add a disable_with attribute with a the new button text.
{{ 'Create Message' | create_button: message.url, disable_with: 'Creating message…' }}
Generates a button to create a resource present on the URL using AJAX. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.
To change the button text on submit, add a disable_with attribute with a the new button text.
{{ 'Create Message' | create_button: message.url, disable_with: 'Creating message…' }}
Create link from given text
{{ "See your App keys" | link_to:'/my-app-keys' }}