Created
September 30, 2016 09:52
-
-
Save zetachang/3c31c8f52f2f4d68dc7166a6be1306bf to your computer and use it in GitHub Desktop.
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
From 22a8d63c748a3abf1dc0dd619d4d3b0d3f848c5c Mon Sep 17 00:00:00 2001 | |
From: David Chang <[email protected]> | |
Date: Fri, 30 Sep 2016 17:50:12 +0800 | |
Subject: [PATCH] Some fix | |
--- | |
application.rb | 7 ++++--- | |
controller.rb | 4 +++- | |
2 files changed, 7 insertions(+), 4 deletions(-) | |
diff --git a/application.rb b/application.rb | |
index f70f59c..1c5cd84 100644 | |
--- a/application.rb | |
+++ b/application.rb | |
@@ -1,10 +1,11 @@ | |
require 'opal' | |
-require 'opal-jquery' | |
require 'react-latest' # or other version i.e. react-v14 | |
-#require 'reactrb'; require 'clock' | |
+require 'reactrb'; require 'clock' | |
+require 'opal-jquery' | |
+ | |
require 'controller' | |
puts "now starting testcase" | |
-puts "testcase is now running" | |
\ No newline at end of file | |
+puts "testcase is now running" | |
diff --git a/controller.rb b/controller.rb | |
index 11ab2c8..ac77353 100644 | |
--- a/controller.rb | |
+++ b/controller.rb | |
@@ -24,7 +24,9 @@ class Controller | |
puts "have react" | |
@status = "react active" | |
Element['.status'].html = "react is active" | |
- Element['.react-status-clock'].each {|i|i.render{ Clock()}} | |
+ Element['.react-status-clock'].each do |i| | |
+ React.render(React.create_element(Clock), i.to_n) | |
+ end | |
else | |
puts "no react" | |
Element['.status'].html = "react not active" | |
-- | |
2.8.4 (Apple Git-73) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment