On Jan 16, 6:13 am, Ichiro Saga <[email protected]> wrote:
> Thanks for the reply, Bill.
> The local variable is an element in an array of strings.  When I tried
> js_function(local_variable.to_s), it said local_variable is undefined.
> When I tried js_function(local_variable), the output was "object
> HTMLDivElement".  Did I miss someting?
>
You would need some escaping so that the "local_variable.to_s" bit
gets evaluated by Ruby. Like maybe:

js_function(<%= local_variable.to_s %>)

or

<%= "js_function(#{local_variable.to_s})" %>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to