File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff 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
1717In 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
2529In 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
You can’t perform that action at this time.
0 commit comments