Sha256: 80ed9aa509e58e3bcdc346b2f2e8ca2edadfb7fad1c9b5fcf3fdae1611acfdea
Contents?: true
Size: 669 Bytes
Versions: 19
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true module Nuntius module Admin module Layouts class AttachmentsController < ApplicationController before_action :set_objects def index end def create params[:attachments].each do |file| @layout.attachments.attach(file) end end def destroy attachment = @layout.attachments.find_by(id: params[:id]) attachment&.purge render :create end private def set_objects @layout = Nuntius::Layout.visible.find(params[:layout_id]) if params[:layout_id] end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems