File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ $ cd my-app
64
64
```
65
65
66
66
##### 2) Add ` webpacker ` and ` react-rails ` to your gemfile:
67
- ```
67
+ ``` ruby
68
68
gem ' webpacker'
69
69
gem ' react-rails'
70
70
```
@@ -83,7 +83,7 @@ This gives you:
83
83
- ` app/javascript/packs/server_rendering.js ` for [ server-side rendering] ( #server-side-rendering )
84
84
85
85
##### 4) Link the JavaScript pack in Rails view using ` javascript_pack_tag ` [ helper] ( https://github.com/rails/webpacker#usage ) :
86
- ```
86
+ ``` erb
87
87
<!-- application.html.erb in Head tag below turbolinks -->
88
88
<%= javascript_pack_tag 'application' %>
89
89
```
@@ -102,7 +102,7 @@ Note: Your component is added to `app/javascript/components/` by default.
102
102
103
103
##### 7) [ Render it in a Rails view] ( #view-helper ) :
104
104
105
- ```
105
+ ``` erb
106
106
<!-- erb: paste this in view -->
107
107
<%= react_component("HelloWorld", { greeting: "Hello from react-rails." }) %>
108
108
```
192
192
193
193
` react-rails ` provides a pre-bundled React.js & a UJS driver to the Rails asset pipeline. Get started by adding the ` react-rails ` gem:
194
194
195
- ```
195
+ ``` ruby
196
196
gem ' react-rails'
197
197
```
198
198
You can’t perform that action at this time.
0 commit comments