【发布时间】:2014-08-10 20:47:46
【问题描述】:
我的索引视图有一个form_tag 用于过滤:
= form_tag action: "index", method: "get" do
= label_tag(:sport_id, "Filter by sport:")
= select_tag(:sport_id, options_from_collection_for_select(Sport.all, :id, :name))
= submit_tag("Filter")
团队控制者:
def index
@teams = Team.paginate(page: params[:page])
# Note: this does not do any filtering yet.
end
当我提交表单时,我收到此错误:
TeamsController#create 中的 ActionController::ParameterMissing
参数缺失或值为空:团队
我不明白为什么 create 操作一开始就会触发。
【问题讨论】: