Class: Caisson::Helpers::Form::Field::Percent
- Defined in:
- lib/caisson/helpers/form/field/percent.rb
Instance Method Summary collapse
-
#build(name, value, options = {}) ⇒ Object
************************************************************************************* PUBLIC INSTANCE METHODS *************************************************************************************.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Caisson::Helpers::Form::Field::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Caisson::Helpers::Form::Field::Base
Instance Method Details
#build(name, value, options = {}) ⇒ Object
************************************************************************************* PUBLIC INSTANCE METHODS *************************************************************************************
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/caisson/helpers/form/field/percent.rb', line 9 def build(name, value, ={}) #options = parse_text_options options #return (text_field_tag(name, value.f_percent(symbol: false), options) + '<span class="postfix">%</span>'.html_safe).html_safe content = '<div class="field-percent">' content += text_field_tag(name, value.f_percent(symbol: false), ) content += content_tag(:span, '%', class: 'postfix') content += '</div>' return content.html_safe end |