Rails Haml 复选框

5
2个回答

11
- for role in Role.find(:all)
  %div
    = check_box_tag "user[role_ids][]", role.id, @user.roles.include?(role)
    = role.name

我刚刚使用了http://html2haml.heroku.com/


0

也许现在还不算太晚,你可以运行html2haml命令。类似这样:html2haml app/views/layout/application.html.erb app/views/layouts/application.html.haml


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接