Module: UsersHelper
- Defined in:
- app/helpers/users_helper.rb
Instance Method Summary collapse
Instance Method Details
#preferences_field(form, name) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/users_helper.rb', line 2 def preferences_field(form, name) html = "" case name when Preference::BOOLEAN_FIELD_REGEXP html += content_tag(:div, class: "controls") do form.label(name, class: "checkbox") do form.check_box(name) + t(name, scope: "helpers.label.user[preferences]") end end else html += form.label(name, class: "control-label") html += content_tag(:div, class: "controls") do form.text_field(name) end end raw(html) end |