I'm trying to set up a route to redirect to my monit interface, but I'm
not sure how to do it. what I'd like is my https://domain.com:3000/monit
to redirect to http://domain.com:2812 .
I tried:
get "/monit" => redirect("#{request.protocol}#{request.host}:2812")
in my config.rb, but it doesn't seem to know about request, base_url or
anything else I can find.
get 'jokes/:number', to: redirect { |params, request|
path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
"http://#{request.host_with_port}/#{path}"
}