Sha256: 9b246cb2e98f23b3ab2488f7579560ce2a49f49b0e976e8552961affe638fd2d
Contents?: true
Size: 993 Bytes
Versions: 16
Compression:
Stored size: 993 Bytes
Contents
class AlbumsController < ApplicationController filter_resource_access layout 'cms' def index @albums = Album.page(params[:search], params[:page]) end def show @album = Album.find(params[:id], :include => :photos) @new_photo = Photo.new(:album_id => @album.id) end def new @album = Album.new end def create @album = Album.new(params[:album]) if @album.save flash[:notice] = "Successfully created album." redirect_to @album else render :action => 'new' end end def edit @album = Album.find(params[:id]) end def update @album = Album.find(params[:id]) if @album.update_attributes(params[:album]) flash[:notice] = "Successfully updated album." redirect_to @album else render :action => 'edit' end end def destroy @album = Album.find(params[:id]) @album.destroy flash[:notice] = "Successfully destroyed album." redirect_to albums_url end end
Version data entries
16 entries across 16 versions & 2 rubygems