<commit_before># Sync 
> This started as a thought experiment that is growing into a viable option for realtime Rails apps without ditching 
  the standard rails stack that we love and are so productive with for a heavy client side MVC framework.


Real-time partials with Rails. Sync lets you render partials for models that, with minimal code, 
update in realtime in the browser when changes occur on the server. In practice, one simply only needs to replace 

    <%= render partial: 'user_row', locals: {user: @user} %>
  
with 

    <%= sync partial: 'user_row', resource: @user %>
    
Then update views realtime with a simple `sync_update(@user)` in the controller without any extra javascript or 
configuration. 

In additoinal to real-time udpates, Sync also provides:

  - Realtime removal of partials from the DOM when the sync'd model is destroyed in the controller via `sync_destroy(@user)`
  - Realtime appending of newly created model's on scoped channels
  - JavaScript/CoffeeScript hooks to override and extend element updates/appends/removes for partials
  - Support for [Faye](http://faye.jcoglan.com/) and [Pusher](http://pusher.com)


## Installation

#### 1) Add the gem to your `Gemfile`

    gem 'sync'
    $ bundle
    $ rails g sync:install<commit_msg>Add ruby/rails version requirements to readme.<commit_after># Sync 
> This started as a thought experiment that is growing into a viable option for realtime Rails apps without ditching 
  the standard rails stack that we love and are so productive with for a heavy client side MVC framework.


Real-time partials with Rails. Sync lets you render partials for models that, with minimal code, 
update in realtime in the browser when changes occur on the server. In practice, one simply only needs to replace 

    <%= render partial: 'user_row', locals: {user: @user} %>
  
with 

    <%= sync partial: 'user_row', resource: @user %>
    
Then update views realtime with a simple `sync_update(@user)` in the controller without any extra javascript or 
configuration. 

In additoinal to real-time udpates, Sync also provides:

  - Realtime removal of partials from the DOM when the sync'd model is destroyed in the controller via `sync_destroy(@user)`
  - Realtime appending of newly created model's on scoped channels
  - JavaScript/CoffeeScript hooks to override and extend element updates/appends/removes for partials
  - Support for [Faye](http://faye.jcoglan.com/) and [Pusher](http://pusher.com)

## Requirements

  - Ruby >= 1.9.2
  - Rails >= 3.1


## Installation

#### 1) Add the gem to your `Gemfile`

    gem 'sync'
    $ bundle
    $ rails g sync:install
{'fraction_non_alphanumeric': 0.07456472369417108, 'fraction_numerical': 0.0026495079485238456, 'mean_word_length': 3.88539741219963, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '694098', 'n_tokens_mistral': 773, 'n_tokens_neox': 715, 'n_words': 345}