Skip to content

Commit f88b6d0

Browse files
committed
updated docs since Gon is now used as a class
1 parent 4b1b1b5 commit f88b6d0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ gem line to your Gemfile and do the following:
4141
1. Write variables by
4242

4343
``` ruby
44-
gon.variable_name = variable_value
44+
Gon.variable_name = variable_value
4545
```
4646

4747
2. In your js you get this by
4848

4949
``` js
50-
gon.variable_name
50+
Gon.variable_name
5151
```
5252

5353
3. profit?
@@ -83,16 +83,16 @@ You put something like this in the action of your controller:
8383
@your_int = 123
8484
@your_array = [1,2]
8585
@your_hash = {'a' => 1, 'b' => 2}
86-
gon.your_int = @your_int
87-
gon.your_other_int = 345 + gon.your_int
88-
gon.your_array = @your_array
89-
gon.your_array << gon.your_int
90-
gon.your_hash = @your_hash
86+
Gon.your_int = @your_int
87+
Gon.your_other_int = 345 + Gon.your_int
88+
Gon.your_array = @your_array
89+
Gon.your_array << Gon.your_int
90+
Gon.your_hash = @your_hash
9191
92-
gon.all_variables # > {:your_int => 123, :your_other_int => 468, :your_array => [1, 2, 123], :your_hash => {'a' => 1, 'b' => 2}}
93-
gon.your_array # > [1, 2, 123]
92+
Gon.all_variables # > {:your_int => 123, :your_other_int => 468, :your_array => [1, 2, 123], :your_hash => {'a' => 1, 'b' => 2}}
93+
Gon.your_array # > [1, 2, 123]
9494
95-
gon.clear # gon.all_variables now is {}
95+
Gon.clear # Gon.all_variables now is {}
9696
```
9797
9898
Access the varaibles from your JavaScript file:
@@ -138,13 +138,13 @@ Use gon with [Jbuilder](https://github.com/rails/jbuilder) as with [Rabl](https:
138138
[Instruction](https://github.com/gazay/gon/wiki/Usage-with-jbuilder) for
139139
usage gon with Jbuilder.
140140
141-
## gon.global
141+
## Gon.global
142142
143143
You can use gon for sending your data to js from anywhere! It's really
144144
great for some init data.
145145

146146
[Instruction](https://github.com/gazay/gon/wiki/Usage-gon-global) for
147-
usage gon.global.
147+
usage Gon.global.
148148

149149
## Contributors
150150

0 commit comments

Comments
 (0)