我在日志中收到以下错误:
应用程序/视图/通知/_nsv_data.html.erb的第18行上的ActionView::TemplateError (nil:NilClass的未定义方法` `name‘):
代码:
<table border="0" cellspacing="0" cellpadding="0">
<% System.get_systems_in_display_order.each do |sys| -%>
<tr>
<td>
<%= check_box_tag "systems[][id]", sys.id, nsv_data.has_system?(sys.id) %>
<%= sys.name %>
<% if sys.can_has_version? -%>
<br/>
<% options = options_for_select( sys.get_system_version_select_options, nsv_data.system_version_ids( sys.id ) ) -%>
<%= select_tag "system_versions[#{sys.id}]", options, { :multiple => true, :size => 5, :id => "system__versions", :class => "system__box" } %>
<% end -%>
</td>
</tr>
<% end -%>
<tr>
<td>
<%= check_box_tag "has_other", 1, nsv_data.has_other_system? %>
Other <%= text_field_tag "other_system[name]", nsv_data.other_system.name %>
</td>
</tr>
我尝试处理的数据是:
Processing NoticesController#update (for 155.70.39.45 at 2012-02-16 14:21:39) PUT Session ID: c5af3ddbc05df2759e9824d62398aab2参数:{“commit”=>“更新”,"other_system"=>{"name"=>""},“notice”=>{“closed_at(4i)”“=>”“,”内部“=>”0“,"severity"=>"3",”=>“,"isc_ticket_id"=>"","will_call_code"=>"",“closed_at(5i)”“=>”“,"ima_table_override"=>"0",”调查“=>”0“,"will_call_at(1i)"=>"","closed"=>"0",”closed_at(1i)“=>”2011“,”will_call_at(2i)“”=>“”,"region_ids"=>"4",“closed_at(2i)”=>“12”,"estimated_resolution(1i)"=>"2012",“description”=>“列表可能无法迁移(ACT=Z和REQTYP=HB)当线路端口具有HSI时。”,"severity_reason"=>"Minimal loss of functionality","will_call_at(3i)"=>"","ticket_id"=>"5352829",“Proof (3i)”=>“12”,"estimated_resolution(2i)"=>"3",“变通办法”=>“提供商应通过每月验证证明报告验证所有列表是否已成功迁移。如果您确定某个列表尚未迁移并与具有HSI的端口TN相关联,请联系您的列表客户经理以获取帮助。“,”closed_at(1i)“=>”,“listing (4i)”=>“09”,"estimated_resolution(3i)"=>"17",“will_call_at(4i)”“=>”“,"will_call_at(5i)"=>"","closed_at(2i)"=>"",”Listing (5i)“=>”07“,"event_error_msg"=>"",“estimated_resolution(4i)”“=>”“,"closed_at(3i)"=>"","new_document_attributes"=>{"uploaded_document"=>#},"escalation"=>"",”impact“=>”列表可能无法迁移(ACT=Z和REQTYP=CB)。“,”estimated_resolution(5i)“”=>“”},“action”=>“=>”,"_method"=>"put",HSI"systems"=>{"id"=>"1"},{"id"=>"7"},"id"=>"1554",“controller”=>“通知”}在布局内呈现模板/主呈现通知/编辑
发布于 2012-02-17 12:04:09
只要添加sys.try(:name)即可。你可能也想看看this。
发布于 2012-02-18 08:20:59
这是数据库的问题,我刚刚重新部署了数据库,它被修复了,这意味着代码是好的。
不过,非常感谢您的帮助:)
https://stackoverflow.com/questions/9321267
复制相似问题