Skip to content

Instantly share code, notes, and snippets.

@zetachang
Created September 30, 2016 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetachang/3c31c8f52f2f4d68dc7166a6be1306bf to your computer and use it in GitHub Desktop.
Save zetachang/3c31c8f52f2f4d68dc7166a6be1306bf to your computer and use it in GitHub Desktop.
From 22a8d63c748a3abf1dc0dd619d4d3b0d3f848c5c Mon Sep 17 00:00:00 2001
From: David Chang <zeta11235813@gmail.com>
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