Class: Oauth::ProvidersController
Instance Method Summary
collapse
#after_sign_in_path_for, #api_authenticate!, #current_project, #expire_revision!, #followed_projects, #no_cache, #read_revision, #require_login, #return_or_cache_revision!, #revision, #unfurling?, #with_current_project
Methods included from UrlHelper
#feature_path, #link_to_project_feature
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/oauth/providers_controller.rb', line 16
def create
@provider = Oauth::Provider.new(params[:oauth_provider])
authorize! :create, @provider
if @provider.save
redirect_to oauth_providers_path
else
render action: :new
end
end
|
#edit ⇒ Object
27
28
29
30
31
|
# File 'app/controllers/oauth/providers_controller.rb', line 27
def edit
@title = "Edit Provider"
@provider = Oauth::Provider.find(params[:id])
authorize! :update, @provider
end
|
#index ⇒ Object
4
5
6
7
8
|
# File 'app/controllers/oauth/providers_controller.rb', line 4
def index
@title = "Providers"
authorize! :read, Oauth::Provider
@providers = Oauth::Provider.all
end
|
#new ⇒ Object
10
11
12
13
14
|
# File 'app/controllers/oauth/providers_controller.rb', line 10
def new
@title = "New Provider"
authorize! :create, Oauth::Provider
@provider = Oauth::Provider.new
end
|
#update ⇒ Object
33
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/oauth/providers_controller.rb', line 33
def update
@provider = Oauth::Provider.find(params[:id])
authorize! :update, @provider
if @provider.update_attributes(params[:oauth_provider])
redirect_to oauth_providers_path
else
render action: :edit
end
end
|