From 27e8d38cea92d165a2e8400b25df23f408b4dca0 Mon Sep 17 00:00:00 2001 From: haseeb Date: Tue, 6 Feb 2018 19:03:18 +0530 Subject: embedded snippets support --- app/controllers/snippets_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers/snippets_controller.rb') 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 -- cgit v1.2.1