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

Version Path
smalruby-editor-0.4.1-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.4.2-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.4.2 app/helpers/users_helper.rb
smalruby-editor-0.4.1 app/helpers/users_helper.rb
smalruby-editor-0.4.0-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.4.0 app/helpers/users_helper.rb
smalruby-editor-0.3.5-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.3.5 app/helpers/users_helper.rb
smalruby-editor-0.3.4-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.3.4 app/helpers/users_helper.rb
smalruby-editor-0.3.3-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.3.3 app/helpers/users_helper.rb
smalruby-editor-0.3.2-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.3.2 app/helpers/users_helper.rb
smalruby-editor-0.3.1-x86-mingw32 app/helpers/users_helper.rb
smalruby-editor-0.3.1 app/helpers/users_helper.rb