Last Updated: February 25, 2016
·
3.666K
· david morrow

Expose Controller Method as a helper in Rails

Ever want access to controller methods from your views in Rails? It's easy.

helper_method :format_something

def format_something
  "abc"
end

Just expose the method using "helper_method"