Sha256: 9ce4e42cf306fe98db54fea40bbbcacf40664ea22ff3ce5b5aa45eaf6d37bf9d
Contents?: true
Size: 945 Bytes
Versions: 1
Compression:
Stored size: 945 Bytes
Contents
class Admin::UsersController < ApplicationController require_role 'admin' layout 'admin' PER_PAGE = 10 def index @users = User.paginate(:page => params[:page], :per_page => PER_PAGE) end def show @user = User.find(params[:id]) end def new @user = User.new end def create @user = User.new(params[:user]) if @user.save flash[:notice] = "User was successfully created." redirect_to :action => 'show', :id => @user else render :action => 'new' end end def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) flash[:notice] = "User was successfully updated." redirect_to :action => 'show', :id => @user else render :action => 'edit' end end def destroy User.find(params[:id]).destroy redirect_to :action => 'index' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
talia_core-0.4.2 | generators/talia_admin/templates/controllers/admin/users_controller.rb |