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
6464```
6565
6666##### 2) Add ` webpacker ` and ` react-rails ` to your gemfile:
67- ```
67+ ``` ruby
6868gem ' webpacker'
6969gem ' react-rails'
7070```
@@ -83,7 +83,7 @@ This gives you:
8383- ` app/javascript/packs/server_rendering.js ` for [ server-side rendering] ( #server-side-rendering )
8484
8585##### 4) Link the JavaScript pack in Rails view using ` javascript_pack_tag ` [ helper] ( https://github.com/rails/webpacker#usage ) :
86- ```
86+ ``` erb
8787<!-- application.html.erb in Head tag below turbolinks -->
8888<%= javascript_pack_tag 'application' %>
8989```
@@ -102,7 +102,7 @@ Note: Your component is added to `app/javascript/components/` by default.
102102
103103##### 7) [ Render it in a Rails view] ( #view-helper ) :
104104
105- ```
105+ ``` erb
106106<!-- erb: paste this in view -->
107107<%= react_component("HelloWorld", { greeting: "Hello from react-rails." }) %>
108108```
192192
193193` react-rails ` provides a pre-bundled React.js & a UJS driver to the Rails asset pipeline. Get started by adding the ` react-rails ` gem:
194194
195- ```
195+ ``` ruby
196196gem ' react-rails'
197197```
198198
You can’t perform that action at this time.
0 commit comments