Skip to content

Commit be22558

Browse files
committed
Merge pull request #81 from hackjoy/patch-1
Update references for location of javscript assets
2 parents b4051e1 + b462d0f commit be22558

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In order to use React client-side in your application, you must make sure the br
3535
You can `require` it in your manifest:
3636

3737
```js
38-
// app/assets/application.js
38+
// app/assets/javascripts/application.js
3939

4040
//= require react
4141
```
@@ -77,7 +77,7 @@ Component = React.createClass
7777
To use `react_ujs`, simply `require` it after `react` (and after `turbolinks` if [Turbolinks](https://github.com/rails/turbolinks) is used):
7878

7979
```js
80-
// app/assets/application.js
80+
// app/assets/javascripts/application.js
8181

8282
//= require turbolinks
8383
//= require react
@@ -118,14 +118,14 @@ gem "therubyrhino", :platforms => :jruby
118118

119119
#### components.js
120120

121-
In order for us to render your React components, we need to be able to find them and load them into the JS VM. By convention, we look for a `assets/components.js` file through the asset pipeline, and load that. For example:
121+
In order for us to render your React components, we need to be able to find them and load them into the JS VM. By convention, we look for a `assets/javascripts/components.js` file through the asset pipeline, and load that. For example:
122122

123123
```sass
124124
// app/assets/javascripts/components.js
125125
//= require_tree ./components
126126
```
127127

128-
This will bring in all files located in the `app/assets/javascripts/components` directory. You can organize your code however you like, as long as a request for `/assets/components.js` brings in a concatenated file containing all of your React components, and each one has to be available in the global scope (either `window` or `global` can be used). For `.js.jsx` files this is not a problem, but if you are using `.js.jsx.coffee` files then the wrapper function needs to be taken into account:
128+
This will bring in all files located in the `app/assets/javascripts/components` directory. You can organize your code however you like, as long as a request for `/assets/javascripts/components.js` brings in a concatenated file containing all of your React components, and each one has to be available in the global scope (either `window` or `global` can be used). For `.js.jsx` files this is not a problem, but if you are using `.js.jsx.coffee` files then the wrapper function needs to be taken into account:
129129

130130
```coffee
131131
###* @jsx React.DOM ###

0 commit comments

Comments
 (0)