about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/media_controller.rb13
1 files changed, 13 insertions, 0 deletions
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