Well i am working with a datagrid in javascript and when a value is
inserted in a column, i need to pass this value to the controller
dynamically.
this is the reason i am trying to do this, to see if the value is being
passed correct:
var product = ‘value’;
alert(encodeURIComponent(’<%=Product.find_by_name(’+product+’)%>’));
other way i have been trying is assigning the value to a session
variable by ajax method.
var product = ‘value’;
new Ajax.Request(’<%= “/” + request.path_parameters[“controller”] +
“/setActualProduct/?pCode=” %>’+product,{);
method: setActualProduct
change a session variable value
The problem is that this session var is render the firsttime you enter
the page
<%pActual=session[:pActual]%>
alert(’<%=pActual%>’);
maybe i will need some observer but to a var instead to a field…