2014-11-06 16:25:27 +01:00
|
|
|
class UsersController < ApplicationController
|
|
|
|
def show
|
2014-11-23 21:12:31 +01:00
|
|
|
@user = User.find(params[:id])
|
2014-11-09 22:53:39 +01:00
|
|
|
@orders = @user.orders.paginate(page: params[:page])
|
2014-11-06 16:25:27 +01:00
|
|
|
end
|
2014-11-06 18:30:53 +01:00
|
|
|
|
2014-11-23 21:12:31 +01:00
|
|
|
def index
|
|
|
|
@users = User.all
|
|
|
|
end
|
2014-12-09 22:32:54 +01:00
|
|
|
|
|
|
|
def destroy
|
|
|
|
User.find(params[:id]).destroy
|
|
|
|
flash[:success] = "Succesfully removed user"
|
|
|
|
redirect_to users_path
|
|
|
|
end
|
|
|
|
|
2014-11-06 16:25:27 +01:00
|
|
|
end
|