Sha256: 640765aa0b6a937e459f79caa429c216b3417cd0ae99ec408b944efa16246f33
Contents?: true
Size: 848 Bytes
Versions: 17
Compression:
Stored size: 848 Bytes
Contents
module Symphonia class AttachmentsController < ApplicationController before_action :require_login, :find_attachment def show # find_attachment render(plain: @attachment.attachment.url(:original), layout: false) end def destroy # find_attachment @attachment.destroy respond_to do |format| format.html do flash[:notice] = t(:"text_#{@attachment.type.underscore}_successfully_destroy") redirect_back_or_default(polymorphic_path(@attachment.attachable)) end format.js end end def reorder # find_attachment new_position = params.require(:position).to_i @attachment.insert_at(new_position) head :ok end private def find_attachment @attachment = Attachment.find(params.require(:id)) end end end
Version data entries
17 entries across 17 versions & 1 rubygems