这条Active Record系列有什么问题?

时间:2017-08-16 04:50:08

标签: ruby-on-rails activerecord

这让我错过了一个错过tIDENTIFIER的错误。似乎看不出有什么问题

      <%= link_to_if(customer.try(:company_id).try(:blank?), "Company: #{@company.find(customer[:company_id].name}", { controller => 'companies', action => 'show', id => customer.company_id }) %>

1 个答案:

答案 0 :(得分:0)

  <%= link_to_if(customer.try(:company_id).try(:blank?), "Company: #{@company.find(customer[:company_id]).name}", { controller => 'companies', action => 'show', id => customer.company_id }) %>

此处缺少@ company.find(客户[:company_id] .name