Sha256: b25155eb2b1b6df966dfa03f717feeeef3587332dad5540fed357c3a6925e3e6
Contents?: true
Size: 797 Bytes
Versions: 13
Compression:
Stored size: 797 Bytes
Contents
class Iugu::PlanController < Iugu::AccountSettingsController before_filter(:only => [:index, :change]) { |c| c.must_be :owner, :id } def index params[:id] ? @account = current_user.accounts.find(params[:id]) : @account = current_user_account.account get_index_data render 'iugu/plan/index' end def change return unless params[:plan] params[:id] ? @account = current_user.accounts.find(params[:id]) : @account = current_user_account.account @account.change_plan(params[:plan]) get_index_data render 'iugu/plan/index' end private def get_index_data @currency = locale_to_currency I18n.locale @plans = Iugu::Api::Plan.with_currency @currency @subscription = Iugu::Api::Subscription.find @account.subscription_id.to_uuid.to_s end end
Version data entries
13 entries across 13 versions & 1 rubygems