Hi i configured custom routes but i got the following errors
Error Number 1: You have a nil object when you didn't expect it! The error occurred while evaluating nil.to_sym
17: <td> <%=quipment.numero_activo_fijo%> </td> 18: <td> <%=quipment.direccion_mac%> </td> 19: <td> <%=quipment.numero_serie%> </td> 20: <td><%= link_to 'Show', quipment %></td> 21: <td><%= link_to 'Edit', edit_equipment_path(quipment) %></td> 22: <td><%= link_to 'Destroy', quipment, :confirm => 'Are you sure?', :method => :delete %></td> 23: </tr>
The thing is that quipment is defined. Here is the source code:
<% for quipment in @equipments %> <tr> <td> <%=quipment.numero_activo_fijo%> </td> <td> <%=quipment.direccion_mac%> </td> <td> <%=quipment.numero_serie%> </td> <td><%= link_to 'Show', quipment %></td> <td><%= link_to 'Edit', edit_equipment_path(quipment) %></td> <td><%= link_to 'Destroy', quipment, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %>
Now if I remove the line 20, 21, 22 from the file i got error number 2 Error number 2:
undefined local variable or method `new_equipment_path' for #<ActionView::Base:0x2aaaae5c3bf8>
Here is the route for equipments
map.resources :equipment, :singular=>:equipment_instance, :collection =>{ :add_equipment => :get, :index => :get }
if i remove the :singular => xxx line the problem is solved but the new methods give me errors
Thank you very much for the help