How can I make this possible?
<script type="text/javascript">
var id = 10;
<% @comment = Comment.find(id) %>
</script>
id is a javascript var.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The value of a javascript variable is set on the client side.
So you can’t access that value on the server side in just one request.
The solution is to make another request (ajax) and pass the variable.