From bd5ad304bac69b34a3c223e9baac532106db7dd8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 17 Sep 2016 17:47:26 +0200 Subject: Adding media controller, 1 webm/compose form allowed, previews generated --- app/controllers/media_controller.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/controllers/media_controller.rb (limited to 'app/controllers') diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb new file mode 100644 index 000000000..5a7b0bcbd --- /dev/null +++ b/app/controllers/media_controller.rb @@ -0,0 +1,13 @@ +class MediaController < ApplicationController + before_action :set_media_attachment + + def show + redirect TagManager.instance.url_for(@media_attachment.status) + end + + private + + def set_media_attachment + @media_attachment = MediaAttachment.where.not(status_id: nil).find(params[:id]) + end +end -- cgit