Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
ecbc11a8
Commit
ecbc11a8
authored
Jul 25, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract setter as before_action
parent
98531fc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
app/controllers/profiles/gpg_keys_controller.rb
app/controllers/profiles/gpg_keys_controller.rb
+8
-4
No files found.
app/controllers/profiles/gpg_keys_controller.rb
View file @
ecbc11a8
class
Profiles::GpgKeysController
<
Profiles
::
ApplicationController
before_action
:set_gpg_key
,
only:
[
:destroy
,
:revoke
]
def
index
@gpg_keys
=
current_user
.
gpg_keys
@gpg_key
=
GpgKey
.
new
...
...
@@ -16,8 +18,7 @@ class Profiles::GpgKeysController < Profiles::ApplicationController
end
def
destroy
@gpp_key
=
current_user
.
gpg_keys
.
find
(
params
[
:id
])
@gpp_key
.
destroy
@gpg_key
.
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
profile_gpg_keys_url
,
status:
302
}
...
...
@@ -26,8 +27,7 @@ class Profiles::GpgKeysController < Profiles::ApplicationController
end
def
revoke
@gpp_key
=
current_user
.
gpg_keys
.
find
(
params
[
:id
])
@gpp_key
.
revoke
@gpg_key
.
revoke
respond_to
do
|
format
|
format
.
html
{
redirect_to
profile_gpg_keys_url
,
status:
302
}
...
...
@@ -40,4 +40,8 @@ class Profiles::GpgKeysController < Profiles::ApplicationController
def
gpg_key_params
params
.
require
(
:gpg_key
).
permit
(
:key
)
end
def
set_gpg_key
@gpg_key
=
current_user
.
gpg_keys
.
find
(
params
[
:id
])
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment