From 21cd7f9f045348886215e55f64a4040d52bb3d99 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 1 Jan 2013 21:22:45 -0600 Subject: [PATCH] don't show empty pickers --- app/controllers/application_controller.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 24b141f1..3ed720ca 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,13 +8,16 @@ class ApplicationController < ActionController::Base # View Helpers def character_picker + characters = Character.where(user_id: session[:user]) + return if characters.length == 0 + html = '' html << '' html << '' @@ -24,13 +27,16 @@ class ApplicationController < ActionController::Base end def equipment_picker + equipment = Equipment.where(user_id: session[:user]) + return if equipment.length == 0 + html = '' html << '' html << '' @@ -40,13 +46,16 @@ class ApplicationController < ActionController::Base end def language_picker + languages = Language.where(user_id: session[:user]) + return if languages.length == 0 + html = '' html << '' html << '' @@ -56,13 +65,16 @@ class ApplicationController < ActionController::Base end def location_picker + locations = Location.where(user_id: session[:user]) + return if locations.length == 0 + html = '' html << '' html << ''