When this line is set in the application.rb file:
config.action_controller.default_url_options = { trailing_slash: true}
The root_url
contains two forward slashes:
www.example.com//
Without that line we get:
www.example.com
The reason we have this is SEO purposes, the site was converted from php and we wanted to maintain consistency.
Question: Is there any way to remove the double forward slash? It only started doing this recently... maybe a recent change in Rails? (We always update to the latest.)
Update: Was able to reproduce with a default app. (Rails 3.2.8) https://github.com/silasj/rails_test_forward_slash
Gihub Issue: https://github.com/rails/rails/issues/8700
This is a rails bug. I tracked it down and submitted a PR to solve the problem https://github.com/rails/rails/pull/8701
I think we can merge it in in the near future. I'll try to backport the patch to 3-2-stable
so that it will be available in the next 3.2.x
release.
EDIT: PR is merged into rails/master and rails/3-2-stable. Sadly a little to lait for 3.2.10, need to wait for the next release ;).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With