views:

27

answers:

1

my routes.rb looks like this

map.resources :bookmarks
map.connect ':controller/:id/:action'
map.connect ':controller/:action'

so i can use urls like this

http://localhost:3000/bookmarks/Ruby/show

but when i try to link from this site to the index site of the project (bookmarks controller and index action) like this

link_to "Startseite",  :controller => "bookmarks"

it links to

http://localhost:3000/bookmarks/Ruby/

instead of

http://localhost:3000/bookmarks/

I know i could use a named route to make it work, but perhaps there is an easier way with link_to without setting up a named route for this?

A: 

Maybe try these:

link_to "Startseite", bookmarks_path
link_to "Startseite", {:controller=>:bookmarks, :action=>:index}
dombesz
the first works fine thanks
12d3