= form_tag movies_path, :id => 'ratings_form', :method => :get do
Include:
- @all_ratings.each do |rating|
= rating
- is_checked = (!@selected_ratings.nil? && @selected_ratings.include?(rating))
= check_box_tag "ratings[#{rating}]", is_checked, is_checked, {:id => "ratings_#{rating}"}
= submit_tag 'Refresh', :id => 'ratings_submit'
答案 0 :(得分:1)
参考: - check_box_tag
更改
check_box_tag "ratings[#{rating}]", is_checked, is_checked, {:id => "ratings_#{rating}"}
到
check_box_tag "ratings[#{rating}]", is_checked, true, {:id => "ratings_#{rating}"}