- A
- C
- D
- G
- L
- M
- N
- P
- R
- S
Source: show
# File app/controllers/application_controller.rb, line 58 def abilities @abilities ||= Six.new end
Source: show
# File app/controllers/application_controller.rb, line 91 def access_denied! render "errors/access_denied", layout: "errors", status: 404 end
Source: show
# File app/controllers/application_controller.rb, line 79 def add_abilities abilities << Ability end
Source: show
# File app/controllers/application_controller.rb, line 43 def after_sign_in_path_for resource if resource.is_a?(User) && resource.respond_to?(:blocked) && resource.blocked sign_out resource flash[:alert] = "Your account is blocked. Retry when an admin unblock it." new_user_session_path else super end end
Source: show
# File app/controllers/application_controller.rb, line 62 def can?(object, action, subject) abilities.allowed?(object, action, subject) end
Source: show
# File app/controllers/application_controller.rb, line 129 def dev_tools Rack::MiniProfiler.authorize_request end
Source: show
# File app/controllers/application_controller.rb, line 99 def git_not_found! render "errors/git_not_found", layout: "errors", status: 404 end
Source: show
# File app/controllers/application_controller.rb, line 29 def log_exception(exception) application_trace = ActionDispatch::ExceptionWrapper.new(env, exception).application_trace application_trace.map!{ |t| " #{t}\n" } logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}" end
Source: show
# File app/controllers/application_controller.rb, line 103 def method_missing(method_sym, *arguments, &block) if method_sym.to_s =~ %r^authorize_(.*)!$/ authorize_project!($1.to_sym) else super end end
Source: show
# File app/controllers/application_controller.rb, line 123 def no_cache_headers response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" end
Source: show
# File app/controllers/application_controller.rb, line 95 def not_found! render "errors/not_found", layout: "errors", status: 404 end
Source: show
# File app/controllers/application_controller.rb, line 66 def project id = params[:project_id] || params[:id] @project = Project.find_with_namespace(id) if @project and can?(current_user, :read_project, @project) @project else @project = nil render_404 end end
Source: show
# File app/controllers/application_controller.rb, line 35 def reject_blocked! if current_user && current_user.blocked sign_out current_user flash[:alert] = "Your account is blocked. Retry when an admin unblock it." redirect_to new_user_session_path end end
Source: show
# File app/controllers/application_controller.rb, line 115 def render_403 render file: Rails.root.join("public", "403"), layout: false, status: "403" end
Source: show
# File app/controllers/application_controller.rb, line 111 def render_404 render file: Rails.root.join("public", "404"), layout: false, status: "404" end