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
Jérome Perrin
gitlab-ce
Commits
cbb90d8f
Commit
cbb90d8f
authored
Sep 21, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor keys controller
parent
4a6ec7c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
app/controllers/profiles/keys_controller.rb
app/controllers/profiles/keys_controller.rb
+7
-1
No files found.
app/controllers/profiles/keys_controller.rb
View file @
cbb90d8f
...
@@ -14,7 +14,7 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -14,7 +14,7 @@ class Profiles::KeysController < Profiles::ApplicationController
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
).
execute
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
).
execute
if
@key
.
persisted?
if
@key
.
persisted?
redirect_to
profile_key_path
(
@key
)
redirect_to
_profile_key_path
else
else
@keys
=
current_user
.
keys
.
select
(
&
:persisted?
)
@keys
=
current_user
.
keys
.
select
(
&
:persisted?
)
render
:index
render
:index
...
@@ -50,6 +50,12 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -50,6 +50,12 @@ class Profiles::KeysController < Profiles::ApplicationController
end
end
end
end
protected
def
redirect_to_profile_key_path
redirect_to
profile_key_path
(
@key
)
end
private
private
def
key_params
def
key_params
...
...
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