Sha256: 9d547357053cf5e1de66ff8e27538f41c5e20b36a1ae2165ab1227f94372a24f

Contents?: true

Size: 885 Bytes

Versions: 15

Compression:

Stored size: 885 Bytes

Contents

class UsersController < ApplicationController
  def index
    @users = User.all
  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
      redirect_to @user, :notice => "Successfully created 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])
      respond_to do |format|
        format.json { respond_with_bip( @user ) }
        format.html { redirect_to @user, :notice  => "Successfully updated user." }
      end
    else
      render :action => 'edit'
    end
  end

  def destroy
    @user = User.find(params[:id])
    @user.destroy
    redirect_to users_url, :notice => "Successfully destroyed user."
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
edit_mode-1.0.5 test_app/app/controllers/users_controller.rb
edit_mode-1.0.4 test_app/app/controllers/users_controller.rb
edit_mode-1.0.3 test_app/app/controllers/users_controller.rb
edit_mode-1.0.2 test_app/app/controllers/users_controller.rb
edit_mode-1.0.1 test_app/app/controllers/users_controller.rb
edit_mode-1.0.0 test_app/app/controllers/users_controller.rb
edit_mode-0.0.9 test_app/app/controllers/users_controller.rb
edit_mode-0.0.8 test_app/app/controllers/users_controller.rb
edit_mode-0.0.7 test_app/app/controllers/users_controller.rb
edit_mode-0.0.6 test_app/app/controllers/users_controller.rb
edit_mode-0.0.5 test_app/app/controllers/users_controller.rb
edit_mode-0.0.4 test_app/app/controllers/users_controller.rb
edit_mode-0.0.3 test_app/app/controllers/users_controller.rb
edit_mode-0.0.2 test_app/app/controllers/users_controller.rb
edit_mode-0.0.1 test_app/app/controllers/users_controller.rb