Using a ruby function rather than a template