display values only when present

This commit is contained in:
Saurabh Bhatia 2014-06-27 11:58:09 +08:00
parent d941e096ba
commit 9b6e967787
1 changed files with 1 additions and 1 deletions

View File

@ -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