Hi Folks.
Hope you can advise a newbie to rails. I have to models set up Site &
Note. A site can have many notes where a note belongs to a site. My 2
models are.
class Note < ActiveRecord::Base
belongs_to :site
end
class Site < ActiveRecord::Base
has_many :notes
end
Within the routes I setup the resources ie.
resources :sites do
resources :notes
end
So an example link from the sites table once I created a site will be.
<%=link_to ‘Add’, new_site_note_path(site) %>
This gives me the URL domain.com/sites/1/notes/new
I think this is correct so far. But I’m just getting a routes error of
No route matches {:action=>“show”, :controller=>“notes”}
Please point me to where I’m going wrong???.