I’m having a url problem that seems like I’m going to overcomplicate
it if I don’t just ask what I’m doing wrong…
My situation is that I’m testing to see if a visitor is accessing a
controller via SSL, and if not, redirect to the same controller via my
secure address. This really only amounts to replacing http with https,
and so I did the following:
redirect_to(:protocol => “https”) if !request.ssl?
I’m doing this via localhost for now, so I’m not expecting it to
actually work. However, I’m getting an incorrect url when I try this:
When I log the url it’s creating with url_for, it’s creating:
httpslocalhost:3000/cart/checkout. This seems incorrect… What am I
doing wrong? I’ve set only_path to false, but that seems to have no
effect.
My alternative would be to parse the url and do the replacement and
redirect myself, but this seems like it should work! What am I doing
wrong?