ruby-on-rails - 带有 simple_form 的语义 ui

标签 ruby-on-rails ruby-on-rails-3 haml simple-form semantic-ui

告诉我如何配置 simple_form。我想使用semantic ui的checkbox,但是当我将checkbox包装在类中时,他变得活跃,也就是说,视觉上它是,但是当你点击该复选框时并没有激活。

    = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
     .ui.three.column.middle.aligned.relaxed.grid.basic.segment
       .column
       .column
       .column
         .ui.form.segment
           #marg.field= f.label :email, 'Email'
           #marg.field=f.input :email, placeholder: 'Email', autofocus: true, label: false
           #marg.field= f.label :password, 'Пароль'
           = f.input :password, :required => false, placeholder: 'Пароль', label: false
           #marg.ui.toggle.checkbox
             = f.input :remember_me, as: :boolean if devise_mapping.rememberable?
           #marg= f.button :submit, 'Войти!', class: 'small ui blue submit button'

/image/ACJeL.png

最佳答案

请尝试一下

= f.input :remember_me, as: :boolean, boolean_style: :inline 

关于ruby-on-rails - 带有 simple_form 的语义 ui,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20771733/

相关文章:

internet-explorer - Haml中的“[ !IE]”条件注释

ruby-on-rails - rake 中止! PG::UndefinedTable: 错误: 关系 "pages"不存在

ruby-on-rails - 使用 Rails 3 和 heroku 上的回形针上传多个文件

mysql - 亚马逊网络服务 mysql2 数据库

ruby-on-rails-3 - 如何处理删除和创建相同行的并发请求?

ruby - 在 Padrino application.haml 模板中选择性地使用yield_content

ruby-on-rails - Rails 查询 : Filter by properties in another table

ruby-on-rails - 无方法错误 : undefined method `validate_presence_of' (Rspec and Shoulda-Matchers)

ruby-on-rails - 如何将条形码阅读器添加到我的 Rails 3.2 应用程序

html - 页面上的多个 form_fors 导致 _method 属性出现问题