refactor keys controller
This commit is contained in:
parent
4a6ec7c947
commit
cbb90d8f84
|
@ -14,7 +14,7 @@ class Profiles::KeysController < Profiles::ApplicationController
|
|||
@key = Keys::CreateService.new(current_user, key_params).execute
|
||||
|
||||
if @key.persisted?
|
||||
redirect_to profile_key_path(@key)
|
||||
redirect_to_profile_key_path
|
||||
else
|
||||
@keys = current_user.keys.select(&:persisted?)
|
||||
render :index
|
||||
|
@ -50,6 +50,12 @@ class Profiles::KeysController < Profiles::ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def redirect_to_profile_key_path
|
||||
redirect_to profile_key_path(@key)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def key_params
|
||||
|
|
Loading…
Reference in New Issue