Sha256: 0ed040338ec2003cb1c15fd5147e6078471819297ff40fba750ee62ae356607b
Contents?: true
Size: 533 Bytes
Versions: 16
Compression:
Stored size: 533 Bytes
Contents
module UsersHelper 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 end
Version data entries
16 entries across 16 versions & 1 rubygems