skyderby/skyderby

View on GitHub
app/controllers/tracks/downloads_controller.rb

Summary

Maintainability
A
15 mins
Test Coverage
module Tracks
  class DownloadsController < ApplicationController
    def show
      @track = Track.find(params[:track_id])

      authorize @track, :download?

      track_file = @track.track_file
      send_file track_file.file.download, filename: track_file.file.original_filename
    end
  end
end