# how to send data from controller to javascripts function

**URL:** <https://discuss.rubyonrails.org/t/how-to-send-data-from-controller-to-javascripts-function/27733>\
**Category:** rubyonrails-talk\
**Created:** [April 9, 2008, 9:03am UTC](https://discuss.rubyonrails.org/t/how-to-send-data-from-controller-to-javascripts-function/27733 "2008-04-09T09:03:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldmine](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@goldmine](https://discuss.rubyonrails.org/u/goldmine)\
**Post date:** [April 9, 2008, 9:03am UTC](https://discuss.rubyonrails.org/t/how-to-send-data-from-controller-to-javascripts-function/27733/1 "2008-04-09T09:03:00Z")

</div>

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?
