Sha256: 01b4ab5985b92b92cd142fd8d4ee6d7e4d48552f57855fa216031f945a467805
Contents?: true
Size: 654 Bytes
Versions: 16
Compression:
Stored size: 654 Bytes
Contents
class ResultCsvsController < ApplicationController respond_to :json before_filter :authorize_from_result, only: [:show] before_filter :log_download, only: [:show] def show respond_to do |format| format.json do url = CsvService.new(params[:id]).url if url render json: { url: url } else render nothing: true, status: 404 end end end end private def authorize_from_result authorize! :read, Result.find(params[:id]) end def log_download Rails.logger.info("Result CSV download requested for result #{params[:id]} by user_id #{current_user.id}") end end
Version data entries
16 entries across 16 versions & 1 rubygems