我的组控制器中有此方法,该控制器正在查找
id
在参数中传递的组的。
def set_group
@group = Group.find(params[:id])
end
我有这条路线,还有其他几条,正在寻找
group_id
而不是
id号
。因为它没有找到
组\u id
它正在抛出此错误。
/accounts/:account_id/groups/:group_id/settings
找不到id为的组=
如何告诉此变量查找
id号
和或
组\u id
?我已在下面列出了此特定实例的所有路线,其中一半需要
id号
另一个需要
组\u id
。
/accounts/:account_id/groups/:group_id/add_map(.:format)
/accounts/:account_id/groups/:group_id/add_map(.:format)
/accounts/:account_id/groups/:group_id/maps(.:format)
/accounts/:account_id/groups/:group_id/add(.:format)
/accounts/:account_id/groups/:group_id/add(.:format)
/accounts/:account_id/groups/:group_id/remove/:id(.:format)
/accounts/:account_id/groups/:group_id/maps/:map_id/remove(.:format)
/accounts/:account_id/groups/:group_id/settings(.:format)
/accounts/:account_id/groups(.:format)
/accounts/:account_id/groups(.:format)
/accounts/:account_id/groups/new(.:format)
/accounts/:account_id/groups/:id(.:format)
/accounts/:account_id/groups/:id(.:format)
/accounts/:account_id/groups/:id(.:format)
/accounts/:account_id/groups/:id(.:format)
我需要一个单独的变量
组\u id
?