I'm redirecting to https like so:
redirect_to :protocol => 'https://', :status => :moved_permanently
However, the parameters don't go through like this. I can pass specific parameters through like this:
redirect_to :protocol => 'https://', :status => :moved_permanently, :param1 => params[:param1], :param2 => params[:param2]
How would I make it so that it just passes through every parameter on the url instead of having to explicitly declare each parameter?
With Rails 4.2 and above, passing the whole params
hash will result in adding ?controller=foo&action=bar
to the querystring. Instead, you should do this:
redirect_to protocol: 'https', params: request.query_parameters
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