我在用户页面中使用了编辑选项......它工作正常,但是当我在组织详细信息页面中应用相同的东西时......它显示错误。语法和错误如下....
这是我的页面名称index.html.erb
,在视图名称中um_org_data
<% @um_org_data.each do |um_org_data| %>
<tr>
<td><%= check_box_tag "deleted_ids[]", um_org_data.id %></td>
<td><%= um_org_data.org_name %></td>
<td><%= um_org_data.org_description%></td>
<td><%= um_org_data.offc_addr%></td>
<td><%= um_org_data.offc_ph%></td>
<td>
<%= link_to "<i class='icon-eye-open'></i>".html_safe, um_org_data,"data-original-title" => "View Details", "data-placement" => "bottom", :rel => "nofollow", :class => 'bg-color-none' %>
<%= link_to "<i class= 'icon-edit'><i/i>".html_safe, edit_um_org_data_path(um_org_data), "data-original-title" => "Edit", "data-placement" => "bottom", :rel => "nofollow", :class => 'bg-color-none'%>
</td>
</tr>
<%end%>
此视图的控制器名称是,此视图um_org_data_controller.rb
的模型是um_org_datum.rb
在数据库中,表名是um_org_data
,以下是表的属性:
id-----> int
org_name-----> varchar(255)
org_description-----> varchar(255)
offc_addr-----> varchar(255)
offc_ph-----> varchar(255)
错误如下:
NoMethodError in Um_org_data#index
undefined method `edit_um_org_data_path' for #<#<Class:0x000000042ab418>:0x007fa9e46f8f48>
<td><%= um_org_data.offc_ph%></td>
<td>
<%= link_to "<i class='icon-eye-open'></i>".html_safe, um_org_data,"data-original-title" => "View Details", "data-placement" => "bottom", :rel => "nofollow", :class => 'bg-color-none' %>
<%= link_to "<i class= 'icon-edit'><i/i>".html_safe, edit_um_org_data_path(um_org_data), "data-original-title" => "Edit", "data-placement" => "bottom", :rel => "nofollow", :class => 'bg-color-none'%>
</td>