README.md in gon-6.0.1 vs README.md in gon-6.1.0
- old
+ new
@@ -2,11 +2,11 @@
[![Join the chat at https://gitter.im/gazay/gon](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gazay/gon?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![Gon. You should try this. If you look closer - you will see an elephant.](https://github.com/gazay/gon/raw/master/doc/logo_small.png)
-[![Build Status](https://secure.travis-ci.org/gazay/gon.png)](http://travis-ci.org/gazay/gon) [![CodeClimate](https://codeclimate.com/github/gazay/gon/badges/gpa.svg)](https://codeclimate.com/github/gazay/gon)
+[![Build Status](https://travis-ci.org/gazay/gon.svg?branch=master)](https://travis-ci.org/gazay/gon) [![CodeClimate](https://codeclimate.com/github/gazay/gon/badges/gpa.svg)](https://codeclimate.com/github/gazay/gon)
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!
Now you can easily renew data in your variables through ajax with [gon.watch](https://github.com/gazay/gon/wiki/Usage-gon-watch)!
@@ -76,25 +76,25 @@
`app/views/layouts/application.html.erb`
``` erb
<head>
<title>some title</title>
- <%= include_gon %>
+ <%= Gon::Base.render_data %>
<!-- include your action js code -->
...
```
-For rails 4:
+For rails 3:
``` erb
- <%= Gon::Base.render_data %>
+ <%= include_gon %>
...
```
You can pass some [options](https://github.com/gazay/gon/wiki/Options)
-to `include_gon` method.
+to `render_data` method.
You put something like this in the action of your controller:
``` ruby
@your_int = 123
@@ -107,10 +107,10 @@
gon.your_hash = @your_hash
gon.all_variables # > {:your_int => 123, :your_other_int => 468, :your_array => [1, 2, 123], :your_hash => {'a' => 1, 'b' => 2}}
gon.your_array # > [1, 2, 123]
-gon.clear # gon.all_variables now is {}
+# gon.clear # gon.all_variables now is {}
```
Access the variables from your JavaScript file:
``` js