module Scrivito class UiController < ActionController::Base def index given_query = request.env['QUERY_STRING'] query = "?#{given_query}" if given_query.present? @application_src = "/#{params['application_path']}#{query}" redirect_to @application_src unless editing_context.editor end private def editing_context EditingContextMiddleware.from_request(request) end end end