router to detect routes based on params
Reported by Matt Aimonetti (mattetti) | April 22nd, 2008 @ 09:35 AM
the router needs to be smarter about matching all available params to a route.
Here is the use case:
I was looking at merb_paginate's plugin. I have nested resources routes as follows:
r.resources :artists do |artists|
artists.resources :photos
end
no default routes.
I want to paginate an artist photos in photos controller:
http://localhost:4000/artists/1/...
I would like the plugin view helper to generate a url such as:
http://localhost:4000/artists/1/...
The problem is that it only generates urls such as:
http://localhost:4000/photos/ind...
I can't seem to find a way to generate the proper url by just passing the params and obviously because I need to generate dynamic routes, I can't rely on the user to pass the named route.
-Matt
Comments and changes to this ticket
-

Matt Aimonetti April 23rd, 2008 @ 09:26 AM
Nervermind, after talking with ivey, turns out you HAVE to pass a named route to do what I want to do.
To get my stuff working, I just modified my code to force the user to pass the name route if needed.
please close this ticket.
Thanks
-
Ezra Zygmuntowicz April 23rd, 2008 @ 09:28 AM
- → State changed from new to resolved
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
