I have a share dialog.
On dev it looks like:
http://xxxxxx.com/stuff
On prod:
https://yyyyyyyyyyy.com/stuff
What's the best rails way to output #Protocol# #URL#
And where can I set these in rails? thanks
You should use request. original_url to get the current URL. Source code on current repo found here.
The Rails controller is the logical center of your application. It coordinates the interaction between the user, the views, and the model. The controller is also a home to a number of important ancillary services. It is responsible for routing external requests to internal actions.
If a "before" filter renders or redirects, the action will not run. If there are additional filters scheduled to run after that filter, they are also cancelled.
request.protocol
request.url
See the request object.
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