I have the following route:
resources :widgets do
resources :orders
end
so that a request, e.g. to /widgets/1/orders/new
goes to OrderController, which can access params[:widget_id]
to know which widget is being purchased.
The problem is this: I use force_ssl
in OrderController. This is causing requests for:
http://www.example.com/widgets/1/orders/new
to be redirected (302) to:
https://www.example.com/
In other words, force_ssl is doing its job (redirecting to https protocol version of URL), but is destroying the parameters specified by the dynamic segment of the route in the process. How can I prevent this from happening (preferable) or work around it in the least offensive way?
Note that this is hosted on Heroku, and so e.g. an Apache redirect won't work for me.