def currency_field(method, options = {})
      # get the symbol for the field.
      sym = options.delete(:currency_symbol) || '$'

      # get the value
      if (val = object.send(method))
        options[:value] = number_with_precision val, precision: 2, delimiter: ','
      end

      # build the field
      fld = text_field(method, options)

      # return the value.
      "<div class=\"input-symbol\"><span>#{CGI::escape_html sym}</span>#{fld}</div>".html_safe
    end
def currency_field(method, options = {})
      # get the symbol for the field.
      sym = options.delete(:currency_symbol) || '$'

      # get the value
      if (val = object.send(method))
        options[:value] = number_with_precision val, precision: 2, delimiter: ','
      end

      # build the field
      fld = text_field(method, options)

      # return the value.
      "<div class=\"input-symbol\"><span>#{CGI::escape_html sym}</span>#{fld}</div>".html_safe
    end
Creates a currency entry field.

 *Valid options:*

 currency_symbol::
       A string used to prefix the input field.  Defaults to '$'.

 All other options will be passed through to the {FormHelper#text_field}[http://apidock.com/rails/ActionView/Helpers/FormHelper/text_field] method.

 The value will be formatted with comma delimiters and two decimal places.

   f.currency :pay_rate