Rails Helpers‹ Back
link_helper(url) will output a
link_to and format the URL and the text that gets output.
If there is no "http://" or "https://" in the URL it will add "http://"
The link text that gets output will strip out "http(s)://" as well as "www."
yes_or_no(boolean) is a simple little helper to convert true/false values in to yes or no.
A small helper to convert country codes in to correct country names.
Note: requires the country_select gem
Will take a dragonfly-stored image and output it as inline SVG and will handle missing assets with a fallback message.
Will take a dragonfly-stored image, run the thumb command passed in to the second argument then compress and optimise for you.
static_map("-34.921619,138.599257", zoom: 15, size: "350x200")
Will generate a google static map.
Zoom and Size are optional arguments.
To use this helper you will need to add in a Google Maps API key that has access to the static maps API.
To make the helper use signed maps instead, you will need to enable the
signed flag in the helper and you will also need to add in a
This helper lives in
ornment_google_maps_helper.rb for easy editing.
Custom DateTime Formats
date.to_s(:ornament_full): 29th of August 2012
date.to_s(:ornament_no_year): 29th of August
date.to_s(:ornament_short): 29 Aug 2012
Koi NavItem helpers
Find out if a nav_item is nested under a particular key:
<%= traverse_for_key(@page.get_nav_item, "header_navigation") -%>
Return a key for the nearest "navigation" key:
<%= traverse_for_nearest_navigation_key(@page.get_nav_item) -%>
Navigation keys are determined at the top of this function in