scube-server/app/controllers/playlists_controller.rb
Thibault Jouan 301205d3f0 Implement playlist edit feature
* Display playlists as links in index
* Move playlist form in a partial
2011-07-13 17:52:27 +00:00

29 lines
530 B
Ruby

class PlaylistsController < ApplicationController
def index
@playlists = Playlist.all
end
def new
@playlist = Playlist.new
end
def create
@playlist = Playlist.new params[:playlist]
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