Sha256: f6d60a3b2ea721443036c64a59b58a4a3926b4113e4aaf6bf4ba9b428be5827d

Contents?: true

Size: 808 Bytes

Versions: 3

Compression:

Stored size: 808 Bytes

Contents

class UsersController < ApplicationController

  respond_to :html

  # GET /users
  def index
    @users = User.all

    respond_with(@users)
  end

  # GET /users/:id
  def show
    @user = User.find(params[:id])

    respond_with(@user)
  end

  # GET /users/new
  def new
    @user = User.new

    respond_with(@user)
  end

  # GET /users/:id/edit
  def edit
    @user = User.find(params[:id])

    respond_with(@user)
  end

  # POST /users
  def create
    @user = User.create(params[:user])

    respond_with(@user)
  end

  # PATCH /users/:id
  def update
    @user = User.find(params[:id])
    @user.attributes = params[:user]
    @user.save

    respond_with(@user)
  end

  # DELETE /users/:id
  def destroy
    @user = User.find(params[:id])
    @user.destroy

    respond_with(@user)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serializer-1.0.2 test/dummy/app/controllers/users_controller.rb
serializer-1.0.1 test/dummy/app/controllers/users_controller.rb
serializer-1.0.0 test/dummy/app/controllers/users_controller.rb