views:

58

answers:

1

this is what I want to do.


a href="javascript:sayHello('an nyung')"> click here /a

this code is in a server side.

and I wanna to call this link from a client side by using ruby.

is there any way to do this?

A: 

You probably mean to use the link_to_remote method:

<%= link_to_remote('click here', say_hello_path('an nyung')) %>

This will make a call to the server when the link is clicked by the user.

tadman
but, the server side code isn't my code. it is just a general website like amazon. In this case, is this code also available? the thing I want to do is just to call the link(javascript function). ;) thanks .
juneng
Sounds like you need to implement something in JavaScript. You should re-post a question with a specific example of what you need to trigger.
tadman