Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Remote Javascript for Ruby on Rails
Ruby
Failed to load latest commit information.
lib 1.0.0, file ending is no .rb
spec multiple calls to locally assigned expressions will now be rendered
.gitignore Initial Commit
Gemfile Initial Commit
LICENSE added license and readme
Rakefile Initial Commit
rbjs.gemspec
readme.md 1.0.0, file ending is no .rb

readme.md

Rbjs is a Ruby DSL that translates 1-to-1 into Javascript

It integrates with Rails 3.1 and 4, and Sinatra

What?

With Rbjs you can transform this (create.js.erb)

<% if @collection %>
  jQuery(<%= j render(@image) %>).appendTo('<%= dom_id @collection %>').hide().show('slide')    
<% else %>
  jQuery(<%= j render(@image) %>).insertAfter('.dropzone').hide().show('slide')
<% end %>

into this (create.js.rb)

if @collection
  jQuery(render @image).appendTo(dom_id @collection).hide!.show('slide')    
else
  jQuery(render @image).insertAfter('.dropzone').hide!.show('slide')
end

Why?

Why not?

Installation

Add the line

gem 'rbjs'

to your Gemfile and run

bundle install

Usage

Please refer to the documentation for a quick example and usage guide.

Something went wrong with that request. Please try again.