Class: Caisson::Helpers::Form::Field::Percent

Inherits:
Base
  • Object
show all
Defined in:
lib/caisson/helpers/form/field/percent.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

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={})
  #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), options)
  content += (:span, '%', class: 'postfix')
  content += '</div>'

  return content.html_safe
end