Class: Doorkeeper::ApplicationsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

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

#destroyObject



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

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

#indexObject



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

def index
  @applications = Application.all
end

#newObject



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

def new
  @application = Application.new
end

#updateObject



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

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