app/models/questionnaire.rb
def title lang=nil
    field = lang ? self.questionnaire_fields.find_by_language(lang) : nil
    the_title = field ? field.title : self.questionnaire_fields.find_by_is_default_language(true).title
    the_title ? the_title : "#Not Specified#"
  end
#Method to facilitate the printing of the Questionnaire Title
#by printing the title in the default language
Method to facilitate the printing of the Questionnaire Title
by printing the title in the default language
Method to facilitate the printing of the Questionnaire Title by printing the title in the default language
def title lang=nil
    field = lang ? self.questionnaire_fields.find_by_language(lang) : nil
    the_title = field ? field.title : self.questionnaire_fields.find_by_is_default_language(true).title
    the_title ? the_title : "#Not Specified#"
  end
def title lang = nil field = lang ? self . questionnaire_fields . find_by_language ( lang ) : nil the_title = field ? field . title : self . questionnaire_fields . find_by_is_default_language ( true ) . title the_title ? the_title : "#Not Specified#" end
Method to facilitate the printing of the Questionnaire Title
by printing the title in the default language
Method to facilitate the printing of the Questionnaire Title by printing the title in the default language
lang