Skip to content

ronin/rjv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rjv (Rails Javascript Variables)

rjv is a set of helpers that can inject any variables from rails to your javascript code.

Usage

Add this code at the bottom of your layout file (before closing body tag).

== rjv_tags

Now you can inject variables in your views:

- set_var 'someVar', 'someValue'

In javascript this variable will be available as:

console.log(app.vars.someVar)

Copyright

Copyright (c) 2013 Michał Młoźniak.

About

Pass variables from rails to javascript

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages