Class: Doorkeeper::ApplicationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/doorkeeper/applications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


16
17
18
19
20
21
22
23
24
# File 'app/controllers/doorkeeper/applications_controller.rb', line 16

def create
  @application = Application.new(application_params)
  if @application.save
    flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
    redirect_to oauth_application_url(@application)
  else
    render :new
  end
end

#destroyObject


35
36
37
38
# File 'app/controllers/doorkeeper/applications_controller.rb', line 35

def destroy
  flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy]) if @application.destroy
  redirect_to oauth_applications_url
end

#indexObject


8
9
10
# File 'app/controllers/doorkeeper/applications_controller.rb', line 8

def index
  @applications = Application.all
end

#newObject


12
13
14
# File 'app/controllers/doorkeeper/applications_controller.rb', line 12

def new
  @application = Application.new
end

#updateObject


26
27
28
29
30
31
32
33
# File 'app/controllers/doorkeeper/applications_controller.rb', line 26

def update
  if @application.update_attributes(application_params)
    flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :update])
    redirect_to oauth_application_url(@application)
  else
    render :edit
  end
end