Sha256: 5b8ca610716bd9709aebe5864cc78d810a9d9b0ce87b956f4b4aeb39d6b82096
Contents?: true
Size: 907 Bytes
Versions: 4
Compression:
Stored size: 907 Bytes
Contents
class GroupsController < ApplicationController def index list render :action => 'list' end def list @group_pages, @groups = paginate :groups, :per_page => 10 end def show @group = Group.find(params[:id]) end def new @group = Group.new end def create @group = Group.new(params[:group]) if @group.save flash[:notice] = 'Group was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end def edit @group = Group.find(params[:id]) end def update @group = Group.find(params[:id]) if @group.update_attributes(params[:group]) flash[:notice] = 'Group was successfully updated.' redirect_to :action => 'show', :id => @group else render :action => 'edit' end end def destroy Group.find(params[:id]).destroy redirect_to :action => 'list' end end
Version data entries
4 entries across 4 versions & 1 rubygems