Class: Effective::FormInputs::PriceField
Constant Summary
Effective::FormInput::BLANK
Instance Attribute Summary
#name, #options
Instance Method Summary
collapse
#feedback_options, #hint_options, #initialize, #input_js_options, #label_options, #to_html, #wrapper_options
Instance Method Details
5
6
7
8
|
# File 'app/models/effective/form_inputs/price_field.rb', line 5
def build_input(&block)
@builder.hidden_field(name, value: price, id: tag_id + '_value_as_integer') +
@template.text_field_tag(name, @template.number_to_currency(currency, unit: ''), options[:input].merge(id: tag_id, name: nil))
end
|
10
11
12
|
# File 'app/models/effective/form_inputs/price_field.rb', line 10
def input_group_options
{ input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('dollar-sign'), class: 'input-group-text') }
end
|
14
15
16
|
# File 'app/models/effective/form_inputs/price_field.rb', line 14
def input_html_options
{ class: 'form-control effective_price', maxlength: 14, autocomplete: 'off', 'data-include-blank': include_blank? }
end
|