Routes problem

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


18: <%=quipment.direccion_mac%>
19: <%=quipment.numero_serie%>
20: <%= link_to ‘Show’, quipment %>
21: <%= link_to ‘Edit’, edit_equipment_path(quipment) %>
22: <%= link_to ‘Destroy’, quipment, :confirm => ‘Are you
sure?’, :method => :delete %>

The thing is that quipment is defined. Here is the source code:

<% for quipment in @equipments %>

<%=quipment.numero_activo_fijo%> <%=quipment.direccion_mac%> <%=quipment.numero_serie%> <%= link_to 'Show', quipment %> <%= link_to 'Edit', edit_equipment_path(quipment) %> <%= link_to 'Destroy', quipment, :confirm => 'Are you sure?', :method => :delete %> <% 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

Here is the route for equipments

map.resources :equipment,
: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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs