Sha256: a2bde9a1a16a236e28286bb96ee345dda86492c3c69abe70d6a353eb065f8042
Contents?: true
Size: 679 Bytes
Versions: 19
Compression:
Stored size: 679 Bytes
Contents
module Spotlight ## # Create image attachments for the sir-trevor image widget class AttachmentsController < ApplicationController before_action :authenticate_user! load_and_authorize_resource :exhibit, class: 'Spotlight::Exhibit' load_and_authorize_resource through: :exhibit # POST /attachments def create @attachment.attributes = attachment_params if @attachment.save render json: @attachment else render action: 'new' end end private # Only allow a trusted parameter "white list" through. def attachment_params params.require(:attachment).permit(:name, :file, :uid) end end end
Version data entries
19 entries across 19 versions & 1 rubygems