tap/app/controllers/users_controller.rb
2014-12-09 22:32:54 +01:00

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