I have a helper in my Ruby on Rails app for the unsecure_url
def unsecure_url
"http://localhost:3000/"
end
However, this is wrong when it the app is live. I just put the app online and would like to do something like this:
def unsecure_url
if is_production
production_url # <-- any way to determine this dynamically?
else
"http://localhost:3000/"
end
end
Any advice on how to do this?
My understanding is you just want to get the URl of the current page?