Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243class ApplicationController < ActionController::Base protect_from_forgery with: :exception force_ssl if: :ssl_configured?
before_action :remove_www before_action :set_gon
def remove_www redirect_to(subdomain: nil) if request.subdomain == 'www' end
def after_sign_out_path_for(_resource_or_scope) request.referrer end
def api_v2_run_url(run) super(run.id) end
def api_v2_run_path(run) super(run.id) end
def not_found raise ActionController::RoutingError.new('Not found') end
def unauthorized raise ActionController::RoutingError.new('Unauthorized') end
private
def set_gon gon.request = {path: request.path} gon.user = current_user end
def ssl_configured? Rails.application.config.use_ssl endend