Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Making baseline Google Spreadsheet and template integration work usin…

…g tabletop and mustache
  • Loading branch information...
commit c505cda89542a5e3549d925797a80f850e8379fe 1 parent e0db603
Nathan Hurst authored

Showing 1 changed file with 13 additions and 2 deletions. Show diff stats Hide diff stats

  1. +13 2 app/assets/javascripts/application.js
15 app/assets/javascripts/application.js
... ... @@ -1,6 +1,8 @@
1 1 //= require jquery
2 2 //= require jquery_ujs
3 3 //= require foundation
  4 +//= require tabletop
  5 +//= require mustache
4 6 //= require_tree .
5 7
6 8 $(document).foundation();
@@ -14,8 +16,17 @@ APP = {
14 16 },
15 17 mail_merges: {
16 18 'new': function() {
17   - alert("new");
18   -
  19 + var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?key=0AuI4VolCrNFLdGF3YUVqQlRTV2ZHZ3hRVTNrQ2VMRFE&output=html';
  20 + Tabletop.init( { key: public_spreadsheet_url,
  21 + callback: APP.mail_merges.display,
  22 + simpleSheet: true } );
  23 + },
  24 + 'display': function(data, tabletop) {
  25 + for(var i = 0; i < data.length; i++) {
  26 + var output = Mustache.render("Say {{greeting}} to {{name}} from {{company}}", data[i]);
  27 + alert(output);
  28 + }
  29 + console.log(data);
19 30 }
20 31 },
21 32 }

0 comments on commit c505cda

Please sign in to comment.
Something went wrong with that request. Please try again.