Class: Saasaparilla::PlansController
Instance Method Summary
collapse
included, #require_current_billable
Instance Method Details
#edit ⇒ Object
6
7
8
|
# File 'app/controllers/saasaparilla/plans_controller.rb', line 6
def edit
@plans = Plan.all(:order => 'price ASC')
end
|
#update ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/saasaparilla/plans_controller.rb', line 10
def update
if params[:subscription][:plan_id] == ""
@subscription.cancel
redirect_to(subscription_path, :notice => 'You have been downgraded to the free plan.')
return
elsif @subscription.downgrade_plan_to(params[:subscription][:plan_id])
redirect_to(subscription_path, :notice => 'Plan was successfully changed.')
else
render :action => "edit"
end
end
|