On Thu, May 24, 2007 at 11:51:57AM +0200, Jamal Soueidan
wrote:> 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 :D
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,
- Jacob Atzen
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---