Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Jsvars packager

Example

In layout paste:

return_jsvars('var Application.config')

Then anywhere in views:

add_jsvars({:url => {:port => 80}})

...

add_jsvars({:url => {:hostname => 'localhost'}})

And you will get:

<script>
var Application.config = {url: {hostname: 'localhost', :port => 80}};
</script>

Copyright (c) 2011 Dmitry A. Ilyashevich, released under the MIT license

About

Simple solution for passing data from Rails to JS

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages