Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-13 19:47:28 +0300
committerDouwe Maan <douwe@selenight.nl>2017-04-30 19:21:20 +0300
commit60ebd101d0fa3ddbfab86a676b81efba589f8393 (patch)
treeec72a89919f726599f8ceefc4d5d4de0539ab7b1 /app/controllers/snippets_controller.rb
parentc205973763e9fddd291a65d241002a0769f84106 (diff)
Use blob viewers for snippets
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 056910fad67..906833505d1 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -3,6 +3,7 @@ class SnippetsController < ApplicationController
include SpammableActions
include SnippetsActions
include MarkdownPreview
+ include RendersBlob
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw, :download]
@@ -60,6 +61,18 @@ class SnippetsController < ApplicationController
end
def show
+ blob = @snippet.blob
+ override_max_blob_size(blob)
+
+ respond_to do |format|
+ format.html do
+ render 'show'
+ end
+
+ format.json do
+ render_blob_json(blob)
+ end
+ end
end
def destroy