This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read contents of file if it exists and hasn't already been read and it exists | |
@@_file_contents ||= (File.read(file_name).strip if File.exists?(file_name)) | |
-- or -- | |
@@_file_contensts ||= File.exists?(file_name) ? File.read(file_name).strip : nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just logging the output from underscore.js .each function, pulling in some json data. | |
var portfolio = '<% _.each(projects, function(iimage, iproject, ilink_to_more_copy, iimage_name, pproject_name, pproject_subtitle, pproject_desc, iimage_desc){ console.log("iimage:", iimage, "iproject", iproject, "ilink_to_more_copy", ilink_to_more_copy, "iimage_name",iimage_name, pproject_name, "pproject_subtitle:", pproject_subtitle, "pproject_desc", pproject_desc, "iimage_desc", iimage_desc); } ) %>'; | |
var template = _.template(portfolio, {projects : [{"iimage":"GHI_Mothers2.jpg","iproject":"5","ilink_to_more_copy":"","iimage_name":"","iimage_desc":"GHI Physicians are the types of professionals that can do anything and go anywhere they choose in life. The Mothers Campaign captures the emotion during those once-in-a-lifetime events when their children make them prouder than they ever could have ever imagined. In this campaign, those momentous occasions happen to correspond directly with the choice they make to become p |