From 4457cb37e3a7d0a42a40118203122e71bdb3210d Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 23 May 2011 14:42:47 +0200 Subject: [PATCH] fix tab index counter. In case of a server restart the global var does not exist anymore causing an error --- app/helpers/todos_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 05e68079..8688b924 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -417,6 +417,9 @@ module TodosHelper end def next_tab_index + # make sure it exists if reset was not called. Set to 20 to avoid clashes with existing form in sidebar + $tracks_tab_index ||= 20 + $tracks_tab_index = $tracks_tab_index + 1 return $tracks_tab_index end