diff options
author | haseeb <haseebeqx@yahoo.com> | 2018-02-06 19:03:18 +0530 |
---|---|---|
committer | haseeb <haseebeqx@yahoo.com> | 2018-02-28 18:48:26 +0530 |
commit | 27e8d38cea92d165a2e8400b25df23f408b4dca0 (patch) | |
tree | 0a16f63c8f380c92fb4185ca21ba8a264c572641 /app/controllers/snippets_controller.rb | |
parent | 56af0631c6c6d838301ac068f2e79b8f4de9fda7 (diff) | |
download | gitlab-ce-27e8d38cea92d165a2e8400b25df23f408b4dca0.tar.gz |
embedded snippets support
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r-- | app/controllers/snippets_controller.rb | 4 |
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 |