12 lines
290 B
Ruby
12 lines
290 B
Ruby
|
class TrackController < ApplicationController
|
||
|
def listen
|
||
|
@track = TrackData.where(id: params[:id])
|
||
|
unless @track.empty?
|
||
|
out = {:status => 'ok', :data => @track.first.files.first[1]}
|
||
|
else
|
||
|
out = {:status => 'no_such_track'}
|
||
|
end
|
||
|
render :json => out
|
||
|
end
|
||
|
end
|