0
我只是试图调用一个模式来编辑产品,但重新定向。使用has_secure_password ..没有任何过滤器..我确实改变了按键的机型..调用模态时出现401未授权错误
class Product < ActiveRecord::Base
belongs_to :merchant, :foreign_key => 'merchant_identifier',
:primary_key => 'merchant_identifier'
end
和我的净价模式..这是我的用户..闲来无事这一点,但有些验证..
class Merchant < ActiveRecord::Base
self.primary_key = 'merchant_identifier'
has_many :products, :foreign_key => 'merchant_identifier',
:primary_key => 'merchant_identifier'
end
这是调用模式
<% @products.each do |product| %>
<tr>
<td><%= link_to "Edit", edit_product_path(product), remote: true,
class: "btn btn-primary btn-sm" %></td>
</tr>
这是产品#编辑的link_to
def edit
@product = Product.find(params[:id])
end
我正在尝试调试,但代码刚刚跳出我的编辑操作并直接转到此错误。任何想法如何我可以更好地调试呢?
Processing by ProductsController#edit as JS
Parameters: {"id"=>"70"}
Completed 401 Unauthorized in 2ms
你能从你的服务器日志发布最后一个请求? –