Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit dd9d998

Browse files
author
Barrie Hadfield
committed
opal and hyper loop express working
1 parent 607b51d commit dd9d998

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

source/_components.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script type="text/ruby">
2+
3+
class App < React::Component::Base
4+
param :name
5+
before_mount { @timer = every(1) { force_update! } }
6+
render(DIV) do
7+
h1 {"The current time is #{Time.now}"}
8+
h2 { "here hello #{params.name}" }.on(:click) do
9+
alert "you clicked"
10+
end
11+
end
12+
end
13+
14+
</script>

source/layout.erb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<%= stylesheet_link_tag 'stylesheet' %>
1818
<%= stylesheet_link_tag 'github-light' %> -->
1919

20+
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
21+
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js"></script>
22+
<script src="https://rawgit.com/reactrb/reactrb-express/master/reactrb-express.js"></script>
23+
2024
<%= stylesheet_link_tag 'bootstrap.min.css' %>
2125
<%= stylesheet_link_tag 'override.css' %>
2226
<%= stylesheet_link_tag 'code.css' %>
@@ -94,9 +98,24 @@
9498
</div>
9599
</div>
96100

101+
<script>
102+
/* Generated by Opal 0.10.3 */
103+
(function(Opal) {
104+
var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice;
105+
106+
Opal.add_stubs(['$puts']);
107+
return self.$puts("opal here")
108+
})(Opal);
109+
</script>
110+
111+
112+
<!-- <script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -->
113+
114+
<!-- clashes with React -->
115+
<!-- <%= javascript_include_tag 'bootstrap.min.js' %> -->
116+
117+
<script type="text/ruby">puts "page loaded"</script>
97118

98-
<script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
99-
<%= javascript_include_tag 'bootstrap.min.js' %>
100119

101120
</body>
102121
</html>

0 commit comments

Comments
 (0)