summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorMarcia Ramos <virtua.creative@gmail.com>2018-04-17 12:38:04 -0300
committerMarcia Ramos <virtua.creative@gmail.com>2018-04-17 12:38:04 -0300
commita9c32fe099db50a1ec147b84ee31dafb9321c3a4 (patch)
tree3b0be4dbd5ce89a3adeb51091808b4200688f99a /app/controllers/snippets_controller.rb
parentd1e0e6815fd5c39683660436aff0581e3ce9f54d (diff)
parent4355a13ad4e04b1ae82b60858376c426ae041699 (diff)
downloadgitlab-ce-a9c32fe099db50a1ec147b84ee31dafb9321c3a4.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into docs-add-badges
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index be2d3f638ff..3d51520ddf4 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -6,6 +6,8 @@ class SnippetsController < ApplicationController
include RendersBlob
include PreviewMarkdown
+ skip_before_action :verify_authenticity_token, only: [:show], if: :js_request?
+
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw]
# Allow read snippet
@@ -77,6 +79,8 @@ class SnippetsController < ApplicationController
format.json do
render_blob_json(blob)
end
+
+ format.js { render 'shared/snippets/show' }
end
end