Sha256: 546f3cd2c7f9617fb5612acdd8971ec44094ffa741b80307672d50ee34da8dac

Contents?: true

Size: 684 Bytes

Versions: 88

Compression:

Stored size: 684 Bytes

Contents

# This allows the app to call f.input :something, :as => :price
# in either Formtastic or SimpleForm, but not both at the same time

if defined?(SimpleForm)
  class PriceInput < SimpleForm::Inputs::NumericInput
    def input(wrapper_options = nil)
      options = merge_wrapper_options(input_html_options, wrapper_options)
      Inputs::PriceField.new(object, object_name, template, attribute_name, options).to_html
    end
  end
elsif defined?(Formtastic)
  class PriceInput < Formtastic::Inputs::NumberInput
    def to_html
      input_wrapping do
        label_html << Inputs::PriceField.new(@object, @object_name, @template, @method, @options).to_html
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
effective_orders-2.2.4 app/models/inputs/price_input.rb
effective_orders-2.2.3 app/models/inputs/price_input.rb
effective_orders-2.2.2 app/models/inputs/price_input.rb
effective_orders-2.2.1 app/models/inputs/price_input.rb
effective_orders-2.2.0 app/models/inputs/price_input.rb
effective_orders-2.1.17 app/models/inputs/price_input.rb
effective_orders-2.1.16 app/models/inputs/price_input.rb
effective_orders-2.1.15 app/models/inputs/price_input.rb
effective_orders-2.1.14 app/models/inputs/price_input.rb
effective_orders-2.1.13 app/models/inputs/price_input.rb
effective_orders-2.1.12 app/models/inputs/price_input.rb
effective_orders-2.1.10 app/models/inputs/price_input.rb
effective_orders-2.1.9 app/models/inputs/price_input.rb
effective_orders-2.1.8 app/models/inputs/price_input.rb
effective_orders-2.1.7 app/models/inputs/price_input.rb
effective_orders-2.1.6 app/models/inputs/price_input.rb
effective_orders-2.1.5 app/models/inputs/price_input.rb
effective_orders-2.1.4 app/models/inputs/price_input.rb
effective_orders-2.1.3 app/models/inputs/price_input.rb
effective_orders-2.1.2 app/models/inputs/price_input.rb