Common rails helper code