Use RABL to build JSON responses given by API

This commit is contained in:
Thibault Jouan
2012-03-11 23:25:57 +00:00
parent 8681999d4c
commit 196ea16a94
7 changed files with 34 additions and 1 deletions

View File

@@ -3,6 +3,5 @@ class Api::V0::PlaylistsController < Api::ApplicationController
def index
@playlists = Playlist.all
respond_with @playlists
end
end

View File

@@ -0,0 +1,4 @@
collection @playlists
attribute :id
attribute :name