Search code examples
rubyactionviewhelper

How do I use an ActionView::Helper in a Ruby script, outside of Rails?


I am looking to use ActionView::Helpers::NumberHelper from a Ruby script. What all do I need to require etc.?


Solution

  • ~> irb
    ruby-1.9.2-p180 :001 > require 'action_view'
     => true 
    ruby-1.9.2-p180 :002 > ActionView::Base.new.number_to_currency 43
     => "$43.00"