views:

28

answers:

0

I am getting the following error, when I follow the "New" link:

equipment_url failed to generate from {:action=>"show", :controller=>"equipment"} - you may have ambiguous routes, or you may need to supply additional parameters for this route.  content_url has the following required parameters: ["equipment", :id] - are they all satisfied?
Extracted source (around line #1):

1: - form_for @equipment do |f|
2:   = f.error_messages
3:   %p
4:     = f.label :name

I generated the scaffold with:

script/generate nifty_scaffold Equipment name:string

I have another one that I generated at the exact same time that is named Company and it has name:string on it too, and it works fine.

Any ideas what the problem could be? I checked routes.rb to make sure that there are no duplicate entries

equipment_controller.rb

  def new
    @equipment = Equipment.new
  end

_form.html.haml

- form_for @equipment do |f|
    = f.error_messages
    %p
      = f.label :name
      %br
      = f.text_field :name
    %p
      = f.submit

new.html.haml

- title "New Equipment"

= render :partial => 'form'

%p= link_to "Back to List", equipment_path

Output of 'rake routes' for equipment

  equipment_index GET    /equipment(.:format)               {:action=>"index", :controller=>"equipment"}
                  POST   /equipment(.:format)               {:action=>"create", :controller=>"equipment"}
    new_equipment GET    /equipment/new(.:format)           {:action=>"new", :controller=>"equipment"}
   edit_equipment GET    /equipment/:id/edit(.:format)      {:action=>"edit", :controller=>"equipment"}
        equipment GET    /equipment/:id(.:format)           {:action=>"show", :controller=>"equipment"}
                  PUT    /equipment/:id(.:format)           {:action=>"update", :controller=>"equipment"}
                  DELETE /equipment/:id(.:format)           {:action=>"destroy", :controller=>"equipment"}