Accessing javascript variable in embedded ruby
===

I use the following JS code in my view to calculate two variables "user_name" and "user_uid":


<script type="text/javascript">
function f1() {
          .
          .
          .
	  user_name = "some variable";
	  user_uid = "another variable";
	});
}
</script>


I'd like to send the two variables "user_name" and "user_uid" to my controller. I use the following code:

    <%= link_to "GO!", new_user_path(:userName => user_name, :userUid => user_id), :remote=> true %> 

My Controller and model work OK. But the two variables are not passed for the JS to the above embedded ruby code. I'd appreciate any pointers on what I'm doing wrong. Thanks!



