17 lines
333 B
Ruby
17 lines
333 B
Ruby
class UsersController < ApplicationController
|
|
def show
|
|
@user = User.find(params[:id])
|
|
@orders = @user.orders.paginate(page: params[:page])
|
|
end
|
|
|
|
def index
|
|
@users = User.all
|
|
end
|
|
|
|
def destroy
|
|
User.find(params[:id]).destroy
|
|
flash[:success] = "Succesfully removed user"
|
|
redirect_to users_path
|
|
end
|
|
|
|
end
|