Commit cbb90d8f authored by James Lopez's avatar James Lopez

refactor keys controller

parent 4a6ec7c9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment