Class: Account::Oauth::StripeAccountsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Account::Oauth::StripeAccountsController
- Defined in:
- app/controllers/account/oauth/stripe_accounts_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /account/oauth/stripe_accounts/:id DELETE /account/oauth/stripe_accounts/:id.json.
-
#edit ⇒ Object
GET /account/oauth/stripe_accounts/:id/edit.
-
#index ⇒ Object
GET /account/users/:user_id/oauth/stripe_accounts GET /account/users/:user_id/oauth/stripe_accounts.json.
-
#new ⇒ Object
GET /account/users/:user_id/oauth/stripe_accounts/new.
-
#show ⇒ Object
GET /account/oauth/stripe_accounts/:id GET /account/oauth/stripe_accounts/:id.json.
-
#update ⇒ Object
PATCH/PUT /account/oauth/stripe_accounts/:id PATCH/PUT /account/oauth/stripe_accounts/:id.json.
Instance Method Details
#destroy ⇒ Object
DELETE /account/oauth/stripe_accounts/:id DELETE /account/oauth/stripe_accounts/:id.json
42 43 44 45 46 47 48 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 42 def destroy @stripe_account.update(user: nil) respond_to do |format| format.html { redirect_to [:account, @user, :oauth, :stripe_accounts], notice: I18n.t("oauth/stripe_accounts.notifications.destroyed") } format.json { head :no_content } end end |
#edit ⇒ Object
GET /account/oauth/stripe_accounts/:id/edit
23 24 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 23 def edit end |
#index ⇒ Object
GET /account/users/:user_id/oauth/stripe_accounts GET /account/users/:user_id/oauth/stripe_accounts.json
6 7 8 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 6 def index redirect_to [:edit, :account, @user] end |
#new ⇒ Object
GET /account/users/:user_id/oauth/stripe_accounts/new
19 20 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 19 def new end |
#show ⇒ Object
GET /account/oauth/stripe_accounts/:id GET /account/oauth/stripe_accounts/:id.json
12 13 14 15 16 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 12 def show unless @stripe_account.integrations_stripe_installations.any? redirect_to [:edit, :account, @user] end end |
#update ⇒ Object
PATCH/PUT /account/oauth/stripe_accounts/:id PATCH/PUT /account/oauth/stripe_accounts/:id.json
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/account/oauth/stripe_accounts_controller.rb', line 28 def update respond_to do |format| if @stripe_account.update(stripe_account_params) format.html { redirect_to [:account, @stripe_account], notice: I18n.t("oauth/stripe_accounts.notifications.updated") } format.json { render :show, status: :ok, location: [:account, @stripe_account] } else format.html { render :edit, status: :unprocessable_entity } format.json { render json: @stripe_account.errors, status: :unprocessable_entity } end end end |