Skip to content

Instantly share code, notes, and snippets.

@frostyblok
Created May 27, 2020 19:59
Show Gist options
  • Save frostyblok/06381476609c37939b4a20ded35a7b91 to your computer and use it in GitHub Desktop.
Save frostyblok/06381476609c37939b4a20ded35a7b91 to your computer and use it in GitHub Desktop.
Subscription Controller
module Admins
class SubscriptionsContoller < ApplicationController
# This is left empty because the instruction clearly says the subscriptions.html.erb
def index; end
# eager loading the subscription entity to include the plan associated data
def subscriptions
@subcriptions = Subscription.order(created_at: :desc).includes(:plan).page(params[:page]).per(100)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment