Topic: Pass JS return value to partial?

Within my view I would like to call a JS function which returns a value that I can then pass to a partial. Can't figure out how to do this or even if you can. Any suggestions? Thanks in advance.

Example ( assume ../views/foo/show.html.erb):

<script language="JavaScript">
   function foo(){
      return 5;

<%= render partial => "my_partial",  locals => {:ref_no => javascript_tag "foo()"} %>

Re: Pass JS return value to partial?

You have misconceptions about the role of Javascript in web applications. What you are trying to do does not make sense.