-5

I have a url that uses https by default:

url = article_url(@article)

Instead of using https I would like the same url but using http

Dercni
  • 1,216
  • 3
  • 18
  • 38
  • Do something like this: https://stackoverflow.com/questions/7908598/add-https-to-url-if-its-not-there – Derek Brown Nov 29 '17 at 20:05
  • Possible duplicate of [Add http(s) to URL if it's not there?](https://stackoverflow.com/questions/7908598/add-https-to-url-if-its-not-there) – showdev Nov 29 '17 at 20:13
  • Quite a bit of research so far but worded the question in it's simplest form. I was looking for a protocol option as part of the rails url helper however the regex solution will do. Thanks. – Dercni Nov 29 '17 at 20:22
  • I hope you are searching for this piece of manual: https://apidock.com/rails/ActionController/Base/default_url_options – DonPaulie Nov 29 '17 at 20:07

1 Answers1

2

The correct answer I was searching for is: https://apidock.com/rails/ActionController/Base/url_for

url_for(controller: 'articles', action: 'show', id: @article.id, protocol: :http)
Dercni
  • 1,216
  • 3
  • 18
  • 38