app/controllers/iugu/account_controller.rb in iugusdk-1.0.4 vs app/controllers/iugu/account_controller.rb in iugusdk-1.0.5

- old
+ new

@@ -45,11 +45,12 @@ redirect_to(account_settings_path, :notice => notice) end def select set_account(current_user, params[:id]) - redirect_to :back + #redirect_to :back + redirect_to IuguSDK::app_main_url rescue ActionController::RedirectBackError redirect_to(account_settings_path, :notice => "Account selected") end @@ -65,11 +66,14 @@ if IuguSDK::enable_subscription_features plan_identifier = params[:plan] || IuguSDK::default_subscription_name currency = locale_to_currency I18n.locale create_parameters = {plan_identifier: plan_identifier, currency: currency, email: current_user.email} end - current_user.accounts << Account.create(create_parameters) - redirect_to account_settings_path + acc = Account.create(create_parameters) + current_user.accounts << acc + #redirect_to account_view_path(acc) + set_account(current_user, acc.id.to_param) + redirect_to IuguSDK::app_main_url end def generate_new_token if IuguSDK::enable_account_api @account = current_user.accounts.find(params[:account_id])