Don't abuse the flash store for displaying SSH Key form errors
This commit is contained in:
parent
01b89ee8f1
commit
1b10724e08
1 changed files with 3 additions and 2 deletions
|
@ -3,7 +3,7 @@ class Profiles::KeysController < Profiles::ApplicationController
|
|||
|
||||
def index
|
||||
@keys = current_user.keys
|
||||
@key = flash[:key] || Key.new
|
||||
@key = Key.new
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -16,7 +16,8 @@ class Profiles::KeysController < Profiles::ApplicationController
|
|||
if @key.save
|
||||
redirect_to profile_key_path(@key)
|
||||
else
|
||||
redirect_to profile_keys_path, flash: { key: @key }
|
||||
@keys = current_user.keys.select(&:persisted?)
|
||||
render :index
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue