Class: Account::Platform::AccessTokensController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/account/platform/access_tokens_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /account/platform/applications/:application_id/access_tokens POST /account/platform/applications/:application_id/access_tokens.json



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 30

def create
  @access_token.provisioned = true

  respond_to do |format|
    if @access_token.save
      format.html { redirect_to [:account, @application, :access_tokens], notice: I18n.t("platform/access_tokens.notifications.created") }
      format.json { render :show, status: :created, location: [:account, @access_token] }
    else
      format.html { render :new, status: :unprocessable_entity }
      format.json { render json: @access_token.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /account/platform/access_tokens/:id DELETE /account/platform/access_tokens/:id.json



60
61
62
63
64
65
66
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 60

def destroy
  @access_token.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @application, :access_tokens], notice: I18n.t("platform/access_tokens.notifications.destroyed") }
    format.json { head :no_content }
  end
end

#editObject

GET /account/platform/access_tokens/:id/edit



25
26
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 25

def edit
end

#indexObject

GET /account/platform/applications/:application_id/access_tokens GET /account/platform/applications/:application_id/access_tokens.json



6
7
8
9
10
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 6

def index
  delegate_json_to_api do
    redirect_to [:account, @application]
  end
end

#newObject

GET /account/platform/applications/:application_id/access_tokens/new



21
22
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 21

def new
end

#showObject

GET /account/platform/access_tokens/:id GET /account/platform/access_tokens/:id.json



14
15
16
17
18
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 14

def show
  delegate_json_to_api do
    redirect_to [:account, @application]
  end
end

#updateObject

PATCH/PUT /account/platform/access_tokens/:id PATCH/PUT /account/platform/access_tokens/:id.json



46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/account/platform/access_tokens_controller.rb', line 46

def update
  respond_to do |format|
    if @access_token.update(access_token_params)
      format.html { redirect_to [:account, @access_token], notice: I18n.t("platform/access_tokens.notifications.updated") }
      format.json { render :show, status: :ok, location: [:account, @access_token] }
    else
      format.html { render :edit, status: :unprocessable_entity }
      format.json { render json: @access_token.errors, status: :unprocessable_entity }
    end
  end
end