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-1.3.9 app/models/inputs/price_input.rb
effective_orders-1.3.8 app/models/inputs/price_input.rb
effective_orders-1.3.7 app/models/inputs/price_input.rb
effective_orders-1.3.6 app/models/inputs/price_input.rb
effective_orders-1.3.5 app/models/inputs/price_input.rb
effective_orders-1.3.4 app/models/inputs/price_input.rb
effective_orders-1.3.3 app/models/inputs/price_input.rb
effective_orders-1.3.2 app/models/inputs/price_input.rb
effective_orders-1.3.1 app/models/inputs/price_input.rb
effective_orders-1.3.0 app/models/inputs/price_input.rb
effective_orders-1.2.13 app/models/inputs/price_input.rb
effective_orders-1.2.12 app/models/inputs/price_input.rb
effective_orders-1.2.11 app/models/inputs/price_input.rb
effective_orders-1.2.10 app/models/inputs/price_input.rb
effective_orders-1.2.9 app/models/inputs/price_input.rb
effective_orders-1.2.8 app/models/inputs/price_input.rb
effective_orders-1.2.7 app/models/inputs/price_input.rb
effective_orders-1.2.6 app/models/inputs/price_input.rb
effective_orders-1.2.5 app/models/inputs/price_input.rb
effective_orders-1.2.4 app/models/inputs/price_input.rb