how to send data from controller to javascripts function

Is there anyway to call javascripts function in rails controller? if I prepared some data in the controller, and i want my javascripts function to handle these data, how should i do?