Skip to content

Commit 0a349f0

Browse files
committed
Added changelog and bumped version to 3.0.0
1 parent 7025aca commit 0a349f0

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CHANGELOG
2+
3+
## 3.0.0
4+
5+
* Almost all code refactored
6+
* Added Gon.global for using gon everywhere
7+
* Included ActionView::Helpers into Rabl::Engine
8+
9+
## 2.3.0
10+
11+
* Don't really remember what was before this version

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
If you need to send some data to your js files and you don't want to do this with long way through views and parsing - use this force!
99

10-
Now with [Jbuilder](https://github.com/rails/jbuilder) and [Rabl](https://github.com/nesquena/rabl) support!
10+
With [Jbuilder](https://github.com/rails/jbuilder) and [Rabl](https://github.com/nesquena/rabl) support!
1111

1212
For Sinatra available [gon-sinatra](https://github.com/gazay/gon-sinatra).
1313

@@ -129,7 +129,7 @@ alert(customNamespace.yourHash)
129129

130130
## Usage with Rabl
131131

132-
Now you can write your variables assign logic to templates with [Rabl](https://github.com/nesquena/rabl).
132+
You can write your variables assign logic to templates with [Rabl](https://github.com/nesquena/rabl).
133133
The way of writing Rabl templates is very clearly described in their repo.
134134

135135
Add Rabl to your Gemfile before requiring gon - because gon checks Rabl constant
@@ -297,18 +297,42 @@ alert(gon.comments[0])
297297
P.s. If you didn't put include_gon tag in your html head area - it
298298
wouldn't work. You can read about this in common usage above.
299299

300+
## gon.global
301+
302+
Now you can use gon for sending your data to js from anywhere!
303+
304+
It works just as simple `gon` but you need to write `Gon.global` instead of `gon` in your ruby code,
305+
`gon.global` in javascript and it will not clear self after each request. All other things the same.
306+
307+
For example I want to tell anybody my application session secret token :) Now with Gon.global it's easy!
308+
309+
`config/initializers/secret_token.rb`
310+
311+
```ruby
312+
GonTest::Application.config.secret_token = 'You can't see my token'
313+
Gon.global.session = 'You can't see it I said'
314+
```
315+
316+
`in some js which can reach window.gon variable`
317+
318+
```javascript
319+
alert(gon.global.session)
320+
```
321+
322+
Thats it!
323+
300324
## Installation
301325

302326
Puts this line into `Gemfile` then run `$ bundle`:
303327

304328
``` ruby
305-
gem 'gon', '2.3.0'
329+
gem 'gon', '3.0.0'
306330
```
307331

308332
Or if you are old-school Rails 2 developer put this into `config/environment.rb` and run `$ rake gems:install`:
309333

310334
``` ruby
311-
config.gem 'gon', :version => '2.3.0'
335+
config.gem 'gon', :version => '3.0.0'
312336
```
313337

314338
Or manually install gon gem: `$ gem install gon`

lib/gon/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Gon
2-
VERSION = '2.3.0'
2+
VERSION = '3.0.0'
33
end

0 commit comments

Comments
 (0)