From 1b10724e08ebce422366745013fb785fc993f1c7 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 3 Mar 2016 15:40:00 -0500 Subject: Don't abuse the flash store for displaying SSH Key form errors --- app/controllers/profiles/keys_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/controllers/profiles/keys_controller.rb') diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 4dadd076728..b88c080352b 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -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 -- cgit v1.2.1