Implement track/index action for API
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Api::TracksController < Api::ApplicationController
|
||||
def index
|
||||
@tracks = Track.all
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
collection @tracks
|
||||
|
||||
attribute :id
|
||||
attribute :name
|
||||
|
||||
node(:sound_url, :if => ->(t) { t.sound? }) { |t| api_sound_url t.sound }
|
||||
Reference in New Issue
Block a user