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]