Implement playlists/create action for API

This commit is contained in:
Thibault Jouan
2012-03-19 02:23:48 +00:00
parent f8ed140af1
commit df6d4991f8
5 changed files with 51 additions and 1 deletions

View File

@@ -4,4 +4,9 @@ class Api::PlaylistsController < Api::ApplicationController
def index
@playlists = Playlist.all
end
def create
@playlist = current_user.playlists.build(params[:playlist].slice(:name))
@playlist.save
end
end

View File

@@ -0,0 +1,4 @@
object @playlist
attribute :id
attribute :name