Class: Doorkeeper::ApplicationsController
Instance Method Summary
collapse
#authenticate_admin!, #authenticate_resource_owner!, #current_resource_owner, #get_error_response_from_exception, #handle_token_exception, included, #resource_owner_from_credentials, #server, #skip_authorization?
Instance Method Details
#create ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 15
def create
@application = Application.new(application_params)
if @application.save
flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :create])
p @application
respond_with [:oauth, @application]
else
render :new
end
end
|
#destroy ⇒ Object
44
45
46
47
48
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 44
def destroy
@application = Application.find(params[:id])
flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :destroy]) if @application.delete
redirect_to oauth_applications_url
end
|
#edit ⇒ Object
30
31
32
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 30
def edit
@application = Application.find(params[:id])
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 7
def index
@applications = Application.find_all
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 11
def new
@application = Application.new
end
|
#show ⇒ Object
26
27
28
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 26
def show
@application = Application.find(params[:id])
end
|
#update ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/doorkeeper/applications_controller.rb', line 34
def update
@application = Application.find(params[:id])
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
|