15 lines
273 B
Ruby
15 lines
273 B
Ruby
module API
|
|
class PlaylistsController < 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
|
|
end
|