scube-server/app/controllers/playlists_controller.rb
2011-07-25 22:56:30 +00:00

29 lines
547 B
Ruby

class PlaylistsController < ApplicationController
def index
@playlists = Playlist.all
end
def new
@playlist = Playlist.new
end
def create
@playlist = Playlist.new(:name => params[:playlist][:name])
if @playlist.save
redirect_to :action => 'index'
else
render :action => 'new'
end
end
def edit
@playlist = Playlist.find(params[:id])
end
def update
@playlist = Playlist.find(params[:id])
@playlist.update_attributes params[:playlist]
redirect_to :action => 'index'
end
end