<commit_before># Gon gem — get your Rails variables in your js

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

## Usage

`app/views/layouts/application.html.erb`

``` erb
<head>
  <title>some title</title>
  <%= include_gon %>
  <!-- include your action js code -->
  ...
```

In action of your controller you put something like this:

``` ruby
@your_variable = 123
Gon.your_variable = @your_variable
Gon.your_other_variable = 345 + @your_variable
```

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

``` js
alert(Gon.your_variable)
alert(Gon.your_other_variable)
```

## Installation

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

``` ruby
gem 'gon', '0.2.0'
```

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

``` ruby
config.gem 'gon', :version => '0.2.0'
```

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

## Contributors

* @gazay

Special thanks to @brainopia and @kossnocorp.

## License<commit_msg>Edited README.md via GitHub<commit_after># Gon gem — get your Rails variables in your js

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

## Usage

`app/views/layouts/application.html.erb`

``` erb
<head>
  <title>some title</title>
  <%= include_gon %>
  <!-- include your action js code -->
  ...
```

In action of your controller you put something like this:

``` ruby
@your_variable = 123
Gon.your_variable = @your_variable
Gon.your_other_variable = 345 + @your_variable
```

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

``` js
alert(Gon.your_variable)
alert(Gon.your_other_variable)
```

## Installation

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

``` ruby
gem 'gon', '0.2.0'
```

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

``` ruby
config.gem 'gon', :version => '0.2.0'
```

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

## Contributors

* @gazay

Special thanks to @brainopia, @kossnocorp and @ai.

## License
{'fraction_non_alphanumeric': 0.12358533272974197, 'fraction_numerical': 0.011770031688546853, 'mean_word_length': 4.0227272727272725, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4239597', 'n_tokens_mistral': 792, 'n_tokens_neox': 720, 'n_words': 275}