How to show by id?

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 :smiley:


On Thu, May 24, 2007 at 11:51:57AM +0200, Jamal S. wrote:

Hope someone can give me a push :smiley:

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 A.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs