无法在haml rails中启用check_box_tag

时间:2014-05-21 12:00:49

标签: ruby-on-rails haml

我尝试在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"

任何建议都会有所帮助。 提前致谢

1 个答案:

答案 0 :(得分:0)

尝试此操作,默认情况下,其值为1

= check_box_tag "ratings[#{rating}]", true