Sha256: 8a933ddd72e7a166d9a6be238eef98badb585aa7283ab29f49f362d5433e3f07
Contents?: true
Size: 725 Bytes
Versions: 5
Compression:
Stored size: 725 Bytes
Contents
before_filter :login_required def index @users = User.all end def new @user = User.new end def create @user = User.new(params[:user]) if @user.save flash[:notice] = "User #{@user.email} created." redirect_to users_url else render 'new' end end def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) redirect_to root_path, :notice => 'User information updated.' else render "edit" end end end def destroy @user = User.find(params[:id]) @user.destroy redirect_to users_url end
Version data entries
5 entries across 5 versions & 1 rubygems