All,
In an RJS template, how could I pass ruby variables values to the
javascript without getting the RJS Exception: rubycode? This is what
I''m
doing (as an example) and is throwing the exception:
index.rjs
========names = ["ruby", "ajax"]
page << "alert(#{names})"
You think that wouldn''t work because its an array, right? Ok, so if I
convert the array to string:
index.rjs
========names = ["ruby", "ajax"]
page << "alert(#{names.to_s})"
still not working.
Also, it is possible to assign a JS variable''s value to a ruby
variable?
Like this pseudo code:
index.rjs
========page << "js_var =
document.getElementById(''my_var'').value"
ruby_var = js_var
Thanks a lot.
-- Mark
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---