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

Commit 82f8ce3

Browse files
fkchangajjahn
authored andcommitted
add JRuby support for server pre rendering
1 parent 7df10b1 commit 82f8ce3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ gem 'reactive-ruby'
6161
gem 'react-rails', '~> 1.3.2'
6262
gem 'opal-rails'
6363
gem 'therubyracer', platforms: :ruby # Required for prerendering
64+
# for JRuby you need the below line instead
65+
# gem 'therubyrhino, platforms: :jruby
66+
6467
```
6568

6669
Run `bundle install` and restart your rails server.
@@ -136,7 +139,7 @@ props), to render the component:
136139
class HomeController < ApplicationController
137140
def show
138141
# render_component uses the controller name to find the 'show' component.
139-
render_component say_hello_to: params[:say_hello_to]
142+
render_component say_hello_to: params[:say_hello_to]
140143
end
141144
end
142145
```
@@ -161,11 +164,11 @@ regardless of the name of the controller method.
161164

162165
Searching for components works like this: Given a controller named
163166
"Foo" then react.rb will search for a module named `Foo` containing the component.
164-
If this fails all modules will be searched (i.e. the name of the controller will be
167+
If this fails all modules will be searched (i.e. the name of the controller will be
165168
ignored.) In either case the search begins at the outer most scope until a match is made.
166169

167170
Thus for example given a controller named `Foo`, components could be found in the `Foo` module,
168-
the `Components::Foo` module, in the outer most scope, or in any nested module.
171+
the `Components::Foo` module, in the outer most scope, or in any nested module.
169172
The way the search works allows for small projects that do not need a lot
170173
of name spacing, and also allows components to be shared across several controllers.
171174

0 commit comments

Comments
 (0)