Complex Simplicity

What’s not possible has never happend

Using helpers inside a controller [rails] [helpers] [custom]

leave a comment »

Needed to do some number_to_currency action in a controller…(don’t aks why :) ) and found this nice code: (adjusted to the helper I needed)

def help
 Helper.instance
end

class Helper
 include Singleton
 include ActionView::Helpers::NumberHelper
end

via Using helpers inside a controller [rails] [helpers] [custom].

Written by Peter Berkenbosch

13 January 2009 at 9:48 pm

Posted in ruby, rubyonrails

Leave a Reply