app/controllers/spotlight/attachments_controller.rb in blacklight-spotlight-0.4.1 vs app/controllers/spotlight/attachments_controller.rb in blacklight-spotlight-0.5.0

- old
+ new

@@ -1,24 +1,26 @@ module Spotlight + ## + # Create image attachments for the sir-trevor image widget class AttachmentsController < ApplicationController - before_filter :authenticate_user! - load_and_authorize_resource :exhibit, class: "Spotlight::Exhibit" + 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 + 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 + # Only allow a trusted parameter "white list" through. + def attachment_params + params.require(:attachment).permit(:name, :file, :uid) + end end end