From fc1ec120ae7e9443649823999bab534da884cb4c Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Thu, 19 Apr 2012 20:37:00 +0000 Subject: [PATCH] Add sound/show action (FIXME: need tests!) --- app/controllers/api/sounds_controller.rb | 7 +++++++ config/routes.rb | 1 + 2 files changed, 8 insertions(+) create mode 100644 app/controllers/api/sounds_controller.rb diff --git a/app/controllers/api/sounds_controller.rb b/app/controllers/api/sounds_controller.rb new file mode 100644 index 0000000..ed95edd --- /dev/null +++ b/app/controllers/api/sounds_controller.rb @@ -0,0 +1,7 @@ +class Api::SoundsController < Api::ApplicationController + # FIXME: add some tests! + def show + sound = Sound.find params[:id] + send_file sound.path, :type => sound.mime_type + end +end diff --git a/config/routes.rb b/config/routes.rb index 09819fe..a4c4137 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ Scube::Application.routes.draw do namespace :api do + resources :sounds, :only => [:show] resources :playlists, :only => [:index, :create] resources :sessions, :only => [:create]