user upgrades: add index action.

This commit is contained in:
evazion
2020-12-25 01:21:54 -06:00
parent 2d50ba6fd5
commit e030a07816
5 changed files with 98 additions and 1 deletions

View File

@@ -15,6 +15,13 @@ class UserUpgradesController < ApplicationController
respond_with(@user_upgrade)
end
def index
@user_upgrades = authorize UserUpgrade.visible(CurrentUser.user).paginated_search(params, count_pages: true)
@user_upgrades = @user_upgrades.includes(:recipient, :purchaser) if request.format.html?
respond_with(@user_upgrades)
end
def show
@user_upgrade = authorize UserUpgrade.find(params[:id])
respond_with(@user_upgrade)