19 lines
328 B
Ruby
19 lines
328 B
Ruby
module API
|
|
class PlaylistsController < ApplicationController
|
|
def index
|
|
@playlists = Playlist.all
|
|
end
|
|
|
|
def create
|
|
@playlist = current_user.playlists.build(playlist_params)
|
|
@playlist.save
|
|
end
|
|
|
|
private
|
|
|
|
def playlist_params
|
|
params.require(:playlist).permit(:name)
|
|
end
|
|
end
|
|
end
|