Class: Inputs::PriceField

Inherits:
Object
  • Object
show all
Defined in:
app/models/inputs/price_field.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, object_name, template, method, opts) ⇒ PriceField

Returns a new instance of PriceField.



5
6
7
8
9
10
11
# File 'app/models/inputs/price_field.rb', line 5

def initialize(object, object_name, template, method, opts)
  @object = object
  @object_name = object_name
  @template = template
  @method = method
  @opts = opts
end

Instance Method Details

#to_htmlObject



13
14
15
16
17
18
19
# File 'app/models/inputs/price_field.rb', line 13

def to_html
  (:div, :class => 'input-group') do
    (:span, '$', :class => 'input-group-addon') +
    text_field_tag(field_name, value, options) +
    hidden_field_tag(field_name, price, :id => price_field)
  end
end