jamal
1
Hello there,
I have a small question how to get id from this URL?
http://domain.com/blog/subjectio+awd+2
This route doesn’t seems to work as I want it?
map.connect ‘blog/:name-:id’,
:controller => “blog”,
:action => “list_by_id”,
:requirements => {:name => /\w+/, :id => /\d+/}}
Hope someone can give me a push
Regards,
Jamal
jamal
2
On Thu, May 24, 2007 at 11:51:57AM +0200, Jamal S. wrote:
Hope someone can give me a push
I don’t see any dashes (-) in the URL you posted. Additionally your
requirement of \w+ will not match the plus.
You could take a look at some of the slug plugins available for
inspiration:
http://agilewebdevelopment.com/plugins/search?search=slug
–
Cheers,