i am trying to do this: var name ="Some Value" mygrid.getCombo(2).get(value); alert(encodeURIComponent(''<%=Product.find_by_name(''+name+'')%>'')); all the code is good, the problem is that var name seems that is not sendin how can i send a javascript var to ruby?? Regards, -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Could you shed more light on what you''re trying to do? I think you''ll need an observe_field call perhaps: http://noobkit.com/show/ruby/rails/rails-edge/actionpack-edge/actionview/helpers/prototypehelper/observe_field.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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... any ideas? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
the answer is Ajax + RJS.> var name ="Some Value" > mygrid.getCombo(2).get(value); > alert(encodeURIComponent(''<%=Product.find_by_name(''+name+'')%>''));<%= remote_function(:url => {<some url>, :name => name}) %> def <responds to some url> render :update do |page| page.alert(Product.find_by_name(params[:name]).id) end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Keynan, i am doing an alert(), but what i really need is to pass this value to javascript function. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---