Module: TbRedirects::HandleRedirects

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/tb_redirects/handle_redirects.rb

Instance Method Summary collapse

Instance Method Details

#check_for_applicable_redirect(error) ⇒ Object



8
9
10
11
12
13
14
# File 'app/controllers/concerns/tb_redirects/handle_redirects.rb', line 8

def check_for_applicable_redirect(error)
  if redirect = TbRedirect.find_with_uri(request.original_url)
    redirect_to redirect.destination, status: :moved_permanently
  else
    handle_request_error(error)
  end
end