javascript - how to pass ruby instance variable as params to js function in a rjs page -


i have instance variable @foo in create controller action , rendering create.rjs template. in rjs template need call js function (with page.call) , pass @foo params. how possible..

it's been years since i've used rjs, might work:

page.call "your_function(#{ escape_javascript(@some_instance_var) })" 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -