URL smashing in Rails 4 if you add trailing slash?

I just updated my blog to Rails 4 of 3. I have all the route diagrams:

get ':year/:month/:permalink' => 'posts#show'

So the routes look like this:

/2012/02/blog_permalink

This works fine, but if I add a slash, I get:

No route matches [GET] "/2012/02/blog_permalink/"

I can't seem to figure it out. I tried adding "/" to the end of the route and using: trailing_slash => true. But both of these did not help.

+4
source share
2 answers

, , , , . , , ​​ .

+2

Application.rb :

config.action_controller.default_url_options = { trailing_slash: true }
-1

All Articles