lzap
lzap

Reputation: 17174

Dots in urls in Rails 3

I have this rule:

match '/xxx/:id/yyy' => 'aaa#bbb', :via => :get

and when I try it with (note the dot)

/xxx/123.456/yyy

I get a routing error. I found I should use requirements parameter, but it seems to work only for 1.X and 2.X versions:

match '/xxx/:id/yyy' => 'aaa#bbb', :via => :get, :requirements => { :id => /[\d\.]*/ }

Not working for me under Rails 3.0. What is the trick?

Thanks

Upvotes: 0

Views: 156

Answers (1)

radosch
radosch

Reputation: 619

This has already several questions for this issue, look around, I myself asked that. Here is like I got it working (like here on stackoverflow, when you klick a Tag like ".net"):

get 'questions/tagged(/:tag)' => "clues#index", :tag => /.*/

Upvotes: 2

Related Questions