From 9b6e9677874591a92e3740a765c0e48004b664cb Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Fri, 27 Jun 2014 11:58:09 +0800 Subject: [PATCH] display values only when present --- app/models/journal_paper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/journal_paper.rb b/app/models/journal_paper.rb index 73e6f33..65c2215 100644 --- a/app/models/journal_paper.rb +++ b/app/models/journal_paper.rb @@ -92,7 +92,7 @@ class JournalPaper end def values_for_view - attribute_values = self.attributes.select{|k,v| v if k.in?(["year","language","isbn","vol_no","issue_no","form_to_start","form_to_end","total_pages","keywords","abstract","publication_date","url","note"])} + attribute_values = self.attributes.select{|k,v| v if (k.in?(["year","language","isbn","vol_no","issue_no","form_to_start","form_to_end","total_pages","keywords","abstract","publication_date","url","note"]) && v.present?)} localized_fields = {"paper_title" => self.attributes["paper_title"][I18n.locale], "journal_title" => self.attributes["journal_title"][I18n.locale]} authors = {"authors" => self.authors} files = Hash.new