Associate a user to his playlists

This commit is contained in:
Thibault Jouan
2011-08-30 10:50:05 +00:00
parent 4f66db2682
commit 7fad9e0402
9 changed files with 48 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ class PlaylistsController < ApplicationController
end
def create
@playlist = Playlist.new(:name => params[:playlist][:name])
@playlist = current_user.playlists.build(params[:playlist])
if @playlist.save
redirect_to :action => 'index'
else