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
Post a Comment