Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 没有将符号隐式转换为哈希_Ruby On Rails_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails 没有将符号隐式转换为哈希

Ruby on rails 没有将符号隐式转换为哈希,ruby-on-rails,ruby-on-rails-4,Ruby On Rails,Ruby On Rails 4,我最近更新了我的路由,以便在我的显示和复制订单操作中为参数[:id]传递令牌。但是,在我的索引中,我有以下视图正在创建错误: ActionView::Template::Error (no implicit conversion of Symbol into Hash): <td><%= link_to("#{order.merchant.name} - #{pluralize(order.item_count, 'Item')}", order_path(order))%&g

我最近更新了我的路由,以便在我的显示和复制订单操作中为参数[:id]传递
令牌。但是,在我的索引中,我有以下视图正在创建错误:

ActionView::Template::Error (no implicit conversion of Symbol into Hash):
<td><%= link_to("#{order.merchant.name} - #{pluralize(order.item_count, 'Item')}", order_path(order))%></td>
我有一种感觉,那是因为我的道路和我传递给他们的论点都是一团糟


我做错了什么?

失败的船。错误发生在我的路线上

resources :orders, only: [:show, :copy_order], params: :token do
  post 'copy_order', to: 'orders#copy_order', on: :member
end

它应该是
param::token
,而不是
param::token

请分享问题中的错误日志。@kirtithor您的意思是什么?我用它引用的那句话更新了我的问题。你说的是“它在制造一个错误”。什么错误?@JTG ActionView::Template::error(没有将符号隐式转换为哈希)也有同样的问题。奇怪的是,在开发过程中,一切都像一个符咒,然后突然在prod上失败了。。你的帖子救了我的命!谢谢这是一段时间以前的事了-很高兴它起了作用D
resources :orders, only: [:index]
resources :orders, only: [:show, :copy_order], params: :token do
  post 'copy_order', to: 'orders#copy_order', on: :member
end
resources :orders, only: [:show, :copy_order], params: :token do
  post 'copy_order', to: 'orders#copy_order', on: :member
end