Skip to content

Commit 728de07

Browse files
committed
Update README.md
1 parent 9625dcb commit 728de07

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

README.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,10 @@ After bundling you need to run the initial installation generator:
1616

1717
$ rails g rails_script:install
1818

19-
After the generator finishes, you will be prompted to add some JavaScript to your application layout. The code is responsible for initializing and call the action specific JavaScript. This snippet should be added before the closing body tag.
19+
After the generator finishes, you will be prompted to add helper call to your application layout. The generated code is responsible for initializing and call the action specific JavaScript. This helper shouyld be called before the closing body tag.
2020

21-
For ERB:
2221
```
23-
<script>
24-
jQuery(function() {
25-
window.$this = new (App.<%= controller_path.split(/\/|_/).map(&:capitalize).join('') %> || App.Base)();
26-
if (typeof $this.<%= action_name %> === 'function') {
27-
return $this.<%= action_name%>.call();
28-
}
29-
});
30-
</script>
31-
```
32-
33-
For HAML:
34-
```
35-
:javascript
36-
jQuery(function() {
37-
window.$this = new (App.#{controller_path.split(/\/|_/).map(&:capitalize).join('')} || App.Base)();
38-
if (typeof $this.#{action_name} === 'function') {
39-
return $this.#{action_name}.call();
40-
}
41-
});
22+
<%= include_rails_script %>
4223
```
4324

4425
## Usage

0 commit comments

Comments
 (0)