我是Ruby的新手,下面是我面临的问题。在我的index.html中,我有一段代码复选框
= form_tag movies_path, :id=>"ratings_form", :method => :get do
Include:
- @all_ratings.each do |rating|
= rating
= check_box_tag "ratings[#{rating}]", :id => "ratings_#{rating}"
= submit_tag 'Refresh', :id => "ratings_submit"
在我的控制器中我有
def index
#@movies = Movie.all
@sort = params[:sort]
@movies = Movie.order(@sort)
@all_ratings = Movie.all_ratings
debugger
end
并且在调试点我希望检查这些复选框的值但是只有nil
(rdb:53) puts params[:ratings]
nil
整个参数
(rdb:53) puts params
{"action"=>"index", "controller"=>"movies"}
nil