views:

37

answers:

1

sorry for my english...

I have some problems using will_paginate and named routes, here is some code (my site is in spanish language):

routes.rb

map.animals '/animales/:scope/:id', :controller => :categories, :action => :show

with these routes I generate urls like:

www.domain.com/animales/mamiferos/perros

but, when pages links are generated I get links like

www.domain.com/animals/perros?page=2&scope=mamiferos

NOTE: I am also using friendly_id.

Thanks in advice ;)

Regards.

+1  A: 

You need to make sure that there is no matching route before the animals route in the routes.rb file. E.g. the default route map.connect ":controller/:action/:id" and the resource definition map.resources :animals should come after the named animals route.

lassej
I don't think that is my case, I havemap.animals '/animales/:scope/:id', :controller => :categories, :action => :show... many lines after ...map.connect ':controller/:action/:id'
el_quick
do you have a _map.resources :animals_ somewhere before?
lassej
yes, I have a map.resources :animals before ;( I removed it and now it's works! thk!(May be you can edit your answer to give a more complete detail)
el_quick