give the value of such function wat you want, but as string,
such as this in a view:
:onclick => "toggle_memos('#{memos[:name]}')"
or
:onclick => "toggle_memos('something')"
and in your *.js
function toggle_memos(foo) {
// doSomethingUsefullWithFoo
console.log(foo);
};
LeFnod
On 15 Jan., 23:13, 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 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.