Skip to content

Instantly share code, notes, and snippets.

@rafaelfranca
Created March 14, 2013 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelfranca/5158873 to your computer and use it in GitHub Desktop.
Save rafaelfranca/5158873 to your computer and use it in GitHub Desktop.
class CurrencyInput < SimpleForm::Inputs::Base

  def input
    input_html_classes.unshift("string currency")
    input_html_options[:type] ||= input_type if html5?

    template.content_tag(:span, "$", class: "add-on") +
    @builder.text_field(attribute_name, input_html_options)
  end
end
f.input :cost, :as => :currency, :wrapper => :append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment