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 <[email protected]> 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/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to