|
|
@@ -26,10 +26,10 @@ class PokemonController < ApplicationController
|
|
|
def destroy
|
|
|
pokemon = Pokemon.find(params[:id])
|
|
|
if pokemon.destroy
|
|
|
- flash.now[:notice] = "Pokemon successfuly deleted."
|
|
|
+ flash.now[:info] = "Pokemon successfuly deleted."
|
|
|
redirect_to pokemon_index_path
|
|
|
else
|
|
|
- flash.now[:alert] = "Failed to delete pokemon."
|
|
|
+ flash.now[:error] = "Failed to delete pokemon."
|
|
|
render :show
|
|
|
end
|
|
|
end
|
|
|
@@ -44,13 +44,13 @@ class PokemonController < ApplicationController
|
|
|
|
|
|
redirect_to pokemon_index_path
|
|
|
rescue PKParse::Error => e
|
|
|
- flash.now[:alert] = e.message
|
|
|
+ flash.now[:error] = e.message
|
|
|
@pokemon = Pokemon.new
|
|
|
render :new
|
|
|
rescue ActiveRecord::ActiveRecordError => e
|
|
|
PKParse.logger.error("Failed to commit parsed results:\n#{e}\n#{e.backtrace.join("\n")}")
|
|
|
|
|
|
- flash.now[:alert] = "Failed to commit the uploaded pokemon."
|
|
|
+ flash.now[:error] = "Failed to commit the uploaded pokemon."
|
|
|
@pokemon = Pokemon.new
|
|
|
render :new
|
|
|
end
|