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"
Written by David Morrow
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#