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.1.1 app/models/inputs/price_input.rb
effective_orders-2.1.0 app/models/inputs/price_input.rb
effective_orders-2.0.1 app/models/inputs/price_input.rb
effective_orders-2.0.0 app/models/inputs/price_input.rb
effective_orders-1.8.1 app/models/inputs/price_input.rb
effective_orders-1.8.0 app/models/inputs/price_input.rb
effective_orders-1.7.5 app/models/inputs/price_input.rb
effective_orders-1.7.4 app/models/inputs/price_input.rb
effective_orders-1.7.3 app/models/inputs/price_input.rb
effective_orders-1.7.2 app/models/inputs/price_input.rb
effective_orders-1.7.1 app/models/inputs/price_input.rb
effective_orders-1.7.0 app/models/inputs/price_input.rb
effective_orders-1.6.6 app/models/inputs/price_input.rb
effective_orders-1.6.5 app/models/inputs/price_input.rb
effective_orders-1.6.4 app/models/inputs/price_input.rb
effective_orders-1.6.3 app/models/inputs/price_input.rb
effective_orders-1.6.1 app/models/inputs/price_input.rb
effective_orders-1.6.0 app/models/inputs/price_input.rb
effective_orders-1.5.9 app/models/inputs/price_input.rb
effective_orders-1.5.8 app/models/inputs/price_input.rb