11
देखने के बजाय मॉडल में "number_to_currency" सहायक विधि का उपयोग कैसे करें?
मैं इस तरह से to_dollarअपने मॉडल में विधि का उपयोग करना चाहूंगा : module JobsHelper def to_dollar(amount) if amount < 0 number_to_currency(amount.abs, :precision => 0, :format => "-%u%n") else number_to_currency(amount, :precision => 0) end end end class Job < ActiveRecord::Base include JobsHelper def details return "Only " + to_dollar(part_amount_received) + …