13 lines
248 B
Ruby
13 lines
248 B
Ruby
class Api::PlaylistsController < Api::ApplicationController
|
|
respond_to :json
|
|
|
|
def index
|
|
@playlists = Playlist.all
|
|
end
|
|
|
|
def create
|
|
@playlist = current_user.playlists.build(params[:playlist].slice(:name))
|
|
@playlist.save
|
|
end
|
|
end
|