Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails helpers for eyeballs.js
Ruby JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
eyeballs_rails.gemspec
init.rb

README.md

eyeballs_rails

eyeballs_rails is a gem for using eyeballs.js in your Ruby on Rails projects.

eyeballs_rails brings the eyeballs_javascripts method to Rails, which wraps javascript_include_tags but also includes all of the eyeballs.js dependencies, including jQuery and mustache. It also includes all of your models and controllers.

Installation

Just add 'eyeballs' and 'eyeballs_rails' to your Gemfile

Using eyeballs in Rails

To install and/or update eyeballs javascripts in your Rails app, from the root directory, run:

eyeballs init

This will vendor eyeballs and its dependencies into public/javascripts/vendor, the config files into public/javascripts/config and set up an initial public/javascripts/app directory.

To create a model, for example Post, just run:

eyeballs generate model Post

Same for controllers:

eyeballs generate controller posts

Finally, at the bottom of your template, just before the </body> tag, put the eyeballs_javascripts helper.

Something went wrong with that request. Please try again.