diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-15 13:40:31 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-15 13:40:31 -0400 |
commit | c016805af84e8a6d36bddb46fae7604b5ee02357 (patch) | |
tree | e1bc3bd8fc29fc06f9c7e6812e00ada032ecd4d5 /app | |
parent | 760f97e9795eae0169540b159d3ae7bedaa31c8a (diff) | |
download | pokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.tar.gz pokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.tar.bz2 pokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.zip |
Actually fixed index page when there's no Pokémon
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/pokeviewer/pokemon_controller.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/pokeviewer/pokemon_controller.rb b/app/controllers/pokeviewer/pokemon_controller.rb index 4b49184..49a743c 100644 --- a/app/controllers/pokeviewer/pokemon_controller.rb +++ b/app/controllers/pokeviewer/pokemon_controller.rb | |||
@@ -21,10 +21,14 @@ module Pokeviewer | |||
21 | end | 21 | end |
22 | end | 22 | end |
23 | 23 | ||
24 | if pokemon.peek and pokemon.peek.first == -1 | 24 | @unaccounted = [] |
25 | @unaccounted = pokemon.next.second | 25 | |
26 | else | 26 | begin |
27 | @unaccounted = [] | 27 | if pokemon.peek.first == -1 |
28 | @unaccounted = pokemon.next.second | ||
29 | end | ||
30 | rescue StopIteration | ||
31 | # There are no Pokémon, but that's fine. | ||
28 | end | 32 | end |
29 | 33 | ||
30 | @trainers = Trainer.order(id: :asc).all.map do |trainer| | 34 | @trainers = Trainer.order(id: :asc).all.map do |trainer| |