Project

rjv

0.0
No commit activity in last 3 years
No release in over 3 years
Pass variables from rails to javascript
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

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.