我尝试在haml中启用check_box,我执行以下操作:
= check_box_tag "ratings[#{rating}]", 1, true
但它没有带有复选标记。我对此表单的整个代码如下所示:
= form_tag movies_path, :method => :get, :id => 'ratings_form' do
Include:
- @all_ratings.each do |rating|
= rating
= check_box_tag "ratings[#{rating}]", 1, true
= submit_tag 'Refresh', id: "ratings_submit"
任何建议都会有所帮助。 提前致谢
答案 0 :(得分:0)
尝试此操作,默认情况下,其值为1
= check_box_tag "ratings[#{rating}]", true