Sha256: ec3523351a85feb55908361c94b54e1996df085c3a4a9d12cb413c99d826c987

Contents?: true

Size: 760 Bytes

Versions: 8

Compression:

Stored size: 760 Bytes

Contents

class UsersController < ApplicationController
  include ReTrack::Sweeper
  re_track :user

  respond_to :html
  before_filter :get_user, only: [:show, :edit, :update, :destroy]

  def index
    @users = User.all
    respond_with(@users)
  end

  def show
    respond_with(@user)
  end

  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    flash[:notice] = 'User was successfully created.' if @user.save
    respond_with(@user)
  end

  def update
    if @user.update_attributes(params[:user])
      flash[:notice] = 'User was successfully updated.'
    end
    respond_with(@user)
  end

  def destroy
    @user.destroy
    respond_with(@user)
  end

  private

  def get_user
    @user = User.find(params[:id])
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
re_track-0.7.4 spec/dummy/app/controllers/users_controller.rb
re_track-0.7.2 spec/dummy/app/controllers/users_controller.rb
re_track-0.7.1 spec/dummy/app/controllers/users_controller.rb
re_track-0.7.0 spec/dummy/app/controllers/users_controller.rb
re_track-0.6.0 spec/dummy/app/controllers/users_controller.rb
re_track-0.5.2 spec/dummy/app/controllers/users_controller.rb
re_track-0.5.1 spec/dummy/app/controllers/users_controller.rb
re_track-0.5.0 spec/dummy/app/controllers/users_controller.rb