summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorLong Nguyen <long.polyglot@gmail.com>2016-05-05 13:26:36 +0700
committerLong Nguyen <long.polyglot@gmail.com>2016-05-05 13:26:36 +0700
commit8dc19494c3fdae366daa8849b5e2a3f58f98878c (patch)
treed9c4a9b5e83ddc1425a81ee3e8f1a2d4beaf3874 /app/controllers/snippets_controller.rb
parentc0f02aad4a1a178109a235d34bd70218c0aec86c (diff)
downloadgitlab-ce-8dc19494c3fdae366daa8849b5e2a3f58f98878c.tar.gz
Remove unused code, update spec, and update changelog
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb20
1 files changed, 1 insertions, 19 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 2daceed039b..f0bd842ca56 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -10,29 +10,11 @@ class SnippetsController < ApplicationController
# Allow destroy snippet
before_action :authorize_admin_snippet!, only: [:destroy]
- skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
+ skip_before_action :authenticate_user!, only: [:show, :raw]
layout 'snippets'
respond_to :html
- def index
- if params[:username].present?
- @user = User.find_by(username: params[:username])
-
- render_404 and return unless @user
-
- @snippets = SnippetsFinder.new.execute(current_user, {
- filter: :by_user,
- user: @user,
- scope: params[:scope] }).
- page(params[:page])
-
- render 'index'
- else
- redirect_to(current_user ? dashboard_snippets_path : explore_snippets_path)
- end
- end
-
def new
@snippet = PersonalSnippet.new
end