Forum: Ruby on Rails How to show by id ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
E3513c4edd6810bb4b9914b58da2a2c3?d=identicon&s=25 Jamal Soueidan (jamal)
on 2007-05-24 11:51
Hello there,

I have a small question how to get id from this URL?

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

Cb98c59a6ff22c72676e756bbd28f266?d=identicon&s=25 Jacob Atzen (Guest)
on 2007-05-24 13:08
(Received via mailing list)
On Thu, May 24, 2007 at 11:51:57AM +0200, Jamal Soueidan wrote:
> 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

- Jacob Atzen
This topic is locked and can not be replied to.