Class: Saasaparilla::Admin::SubscriptionsController
Instance Method Summary
collapse
included
included, #require_current_billable
Instance Method Details
#cancel ⇒ Object
27
28
29
30
31
32
|
# File 'app/controllers/saasaparilla/admin/subscriptions_controller.rb', line 27
def cancel
@subscription = Subscription.find(params[:id])
@subscription.cancel
redirect_to admin_subscription_path(@subscription)
flash[:notice] = "Subscription was canceled."
end
|
#index ⇒ Object
8
9
10
|
# File 'app/controllers/saasaparilla/admin/subscriptions_controller.rb', line 8
def index
@subscriptions = Subscription.paginate(:page => params[:page], :per_page => 20, :order => "created_at DESC")
end
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/saasaparilla/admin/subscriptions_controller.rb', line 12
def show
@subscription = Subscription.find(params[:id])
end
|
#toggle_no_charge ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/saasaparilla/admin/subscriptions_controller.rb', line 16
def toggle_no_charge
@subscription = Subscription.find(params[:id])
@subscription.toggle!(:no_charge)
redirect_to admin_subscription_path(@subscription)
if @subscription.no_charge
flash[:notice] = "Subscription will not be charged."
else
flash[:notice] = "Subscription will now be charged."
end
end
|