Skip to content

Commit a4f0807

Browse files
committed
Added types to description
1 parent 3312851 commit a4f0807

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,22 @@ If you need to send some data to your js files and you don't want to do this wit
1717
In action of your controller you put something like this:
1818

1919
``` ruby
20-
@your_variable = 123
21-
Gon.your_variable = @your_variable
22-
Gon.your_other_variable = 345 + @your_variable
20+
@your_int = 123
21+
@your_array = [1,2]
22+
@your_hash = {'a' => 1, 'b' => 2}
23+
Gon.your_int = @your_int
24+
Gon.your_other_int = 345 + @your_int
25+
Gon.your_array = @your_array
26+
Gon.your_hash = @your_hash
2327
```
2428

2529
In javascript file for view of this action write call to your variable:
2630

2731
``` js
28-
alert(Gon.your_variable)
29-
alert(Gon.your_other_variable)
32+
alert(Gon.your_int)
33+
alert(Gon.your_other_int)
34+
alert(Gon.your_array)
35+
alert(Gon.your_hash)
3036
```
3137

3238
## Installation

0 commit comments

Comments
 (0)