Class: PlansController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PlansController
- Defined in:
- app/controllers/plans_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
9 10 11 12 |
# File 'app/controllers/plans_controller.rb', line 9 def edit @plans = Plan.ordered @account = current_account end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/plans_controller.rb', line 4 def index @plans = Plan.ordered notify_observers_of_plan_list_view end |
#update ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/plans_controller.rb', line 14 def update @plans = Plan.ordered @account = current_account from_plan = @account.plan if @account.save_customer_and_subscription!(params[:account]) to_plan = @account.plan notify_observers_of_plan_change(from_plan, to_plan) redirect_to edit_account_path(@account), :notice => t('.update.notice', :default => "Plan changed successfully") else render :edit end end |