Hi, Aaron Day!
Looks like you use "http://localhost:3000/covers/home" query instead
of "http://localhost:3000/covers" for access to home action in covers
controller.
But it really stange, how you add a specific route..
try to use
map.resources :covers, :collection => { :home => :get }
# then use home_covers_path
# it should generate ''/covers/home''
or, if you want only rename index action
map.home ''covers'', :controller =>
''covers'', :action => ''index''
# then use home_path
# it should generate ''/covers''
you can find much more competent explanation in this screencast
http://railscasts.com/episodes/34-named-routes
On Jun 5, 1:02 pm, Aaron Day
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I will try to word this as simple as possible...
>
> I made a scaffold called ''cover'' then migrated the table.
>
> Of course the index, show, edit, and new .html.erb files work correctly
> when they are called BUT, when I created a new .html.erb called
''home'' I
> routed it as so:
>
> map.connect ''/covers/'',
:controller=>''covers'', :action=>''home''
>
> and added
>
> def home
> end
>
> I get the error "Couldn''t find Cover with ID=home"
>
> I want that page to show content of the scaffold but before I add more
> to the controller I want to make the page route "url" work.
>
> Is my route wrong? Do I need to add something to the controller?
>
> I''m trying to keep the application in 1 folder and staying away
from the
> has_many code.
> --
> Posted viahttp://www.ruby-forum.com/.