Commit f144061

mo khan <mo@mokhan.ca>
2015-06-23 01:42:39
move template string to .ractive template file.
1 parent 340c9f0
Changed files (4)
app/assets/javascripts/templates/google_sync_button.ractive
@@ -0,0 +1,1 @@
+<button on-click='synchronize'><i class='fa {{icon}}'></i> {{text}}</button>
app/assets/javascripts/views/google_sync_button.js.coffee
@@ -1,5 +1,6 @@
+#= require models/google_drive
 Stronglifters.GoogleSyncButton = Ractive.extend
-  template: "<button on-click='synchronize'><i class='fa {{icon}}'></i> {{text}}</button>",
+  template: RactiveTemplates["templates/google_sync_button"]
   oninit: ->
     @set(text: 'Sync with Google', icon: 'fa-camera-retro')
     @on 'synchronize', (event) ->
@@ -10,7 +11,7 @@ Stronglifters.GoogleSyncButton = Ractive.extend
     @drive().syncFile()
 
   drive: ->
-    @drive ||= new Stronglifters.GoogleDrive
+    @_drive ||= new Stronglifters.GoogleDrive
       client_id: @get('client_id')
       drive_upload_path: @get('drive_upload_path')
 
Gemfile
@@ -40,6 +40,7 @@ gem 'dalli'
 gem 'sequel'
 gem 'rubyzip', require: "zip"
 gem 'font-awesome-rails'
+gem 'ractive-rails'
 
 source 'https://rails-assets.org' do
   gem 'rails-assets-ractive'
Gemfile.lock
@@ -192,6 +192,10 @@ GEM
     rack-test (0.6.3)
       rack (>= 1.0)
     rack-timeout (0.2.4)
+    ractive-rails (0.0.3)
+      execjs (>= 1.3)
+      sprockets (>= 2.0)
+      tilt (>= 1.3)
     rails (4.2.1)
       actionmailer (= 4.2.1)
       actionpack (= 4.2.1)
@@ -367,6 +371,7 @@ DEPENDENCIES
   puma
   rack-mini-profiler
   rack-timeout
+  ractive-rails
   rails (~> 4.2)
   rails-assets-ractive!
   rails-erd