Refactor controllers

This commit is contained in:
Thibault Jouan
2015-05-02 00:24:30 +00:00
parent 6001cd2e79
commit 8b226998a4
8 changed files with 51 additions and 17 deletions

View File

@@ -1,9 +1,16 @@
module API
class SoundsController < ApplicationController
# FIXME: add some tests!
before_action :set_sound, only: :show
def show
sound = Sound.find(params[:id])
send_file sound.path, type: sound.mime_type
end
private
def set_sound
@sound = Sound.find(params[:id])
end
end
end