Use RABL to build JSON responses given by API
This commit is contained in:
@@ -3,6 +3,5 @@ class Api::V0::PlaylistsController < Api::ApplicationController
|
||||
|
||||
def index
|
||||
@playlists = Playlist.all
|
||||
respond_with @playlists
|
||||
end
|
||||
end
|
||||
|
4
app/views/api/v0/playlists/index.rabl
Normal file
4
app/views/api/v0/playlists/index.rabl
Normal file
@@ -0,0 +1,4 @@
|
||||
collection @playlists
|
||||
|
||||
attribute :id
|
||||
attribute :name
|
Reference in New Issue
Block a user