Problem about javascript in RoR

The problem is that if i want to change the value of a html element
like textfield in the function in controller, how can i get that?

example:

def

#like following
<javascript tag change the element’s value>

end

Try

page[‘id_of_element’].value = “new value”

Ivor