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

Commit 663bfa1

Browse files
author
Barrie Hadfield
committed
basic code editor component
1 parent f195e87 commit 663bfa1

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

source/_components.html.erb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
<script type="text/ruby">
22

3-
class App < React::Component::Base
3+
class CodeEditor < React::Component::Base
4+
5+
render do
6+
div.row do
7+
div.col_md_6 { code_card }
8+
div.col_md_6 { result_card }
9+
end
10+
end
11+
12+
def code_card
13+
div.card_block do
14+
p { "here" }
15+
end
16+
end
17+
18+
def result_card
19+
div.card_block do
20+
p { "there" }
21+
end
22+
end
23+
end
24+
25+
class TestApp < React::Component::Base
426
param :name
527
before_mount { @timer = every(1) { force_update! } }
628
render(DIV) do

source/index.html.md renamed to source/index.html.md.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<div data-reactrb-mount="CodeEditor"></div>
2+
13
## Pure Ruby
24
Hyperloop lets you build beautiful interactive user interfaces using the same Ruby language running your server side code. Hyperloop replaces JS code, JSX, HTML, templating languages, and complex frameworks with one simple system.
35

@@ -7,7 +9,7 @@ One language. One simple model. Under the hood the Hyperloop gems takes care of
79
## HyperReact = React + Ruby
810
The power and simplicity of React with a great easy to use Ruby DSL. HyperReact frees you up to do what you do best - building great apps.
911

10-
HyperReact is a wrapper for the React.js library for creating user interfaces. HyperReact provides all the goodness of React combined with the expressiveness of the Ruby language.
12+
HyperReact is a wrapper for the React.js library for creating user interfaces. HyperReact provides all the goodness of React combined with the expressiveness of the Ruby language.
1113

1214
React was built to solve one problem: building large applications with data that changes over time.
1315

source/layout.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@
105105
(function(Opal) {
106106
var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice;
107107
Opal.add_stubs(['$puts']);
108-
return self.$puts("Opal working")
108+
return self.$puts("Opal ok")
109109
})(Opal);
110110
</script>
111111

112112
<!-- <script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -->
113113

114-
<script type="text/ruby">puts "Hyperloop Express working"</script>
114+
<script type="text/ruby">puts "Hyperloop Express ok"</script>
115+
116+
<%= partial "_components" %>
115117

116118
</body>
117119
</html>

0 commit comments

Comments
 (0)