Don't abuse the flash store for displaying SSH Key form errors

This commit is contained in:
Robert Speicher 2016-03-03 15:40:00 -05:00
parent 01b89ee8f1
commit 1b10724e08

View file

@ -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