Specifying Entire Path As Optional Rails 3.0.0

Posted by Kevin Sylvestre on Stack Overflow See other posts from Stack Overflow or by Kevin Sylvestre
Published on 2010-06-11T20:58:03Z Indexed on 2010/06/11 21:03 UTC
Read the original article Hit count: 186

I want to create a Rails 3 route with entirely optional parameters. The example route is:

match '(/name/:name)(/height/:height)(/weight/:weight)' => 'people#index'

The route works if I specify it as:

match '/people(/name/:name)(/height/:height)(/weight/:weight)' => 'people#index'

But I want to have this as the root URL. Thanks.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails3