i have a JavaScript variable and i need to pass that to controller with the remote_function method. how do i pass this? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nirosh wrote:> i have a JavaScript variable and i need to pass that to controller > with the remote_function method. > how do i pass this?The same way you pass any parameters using HTTP. You can either put them in the query string or in the form data of a POST request. Make sure you encode them properly using URL encoding. http://en.wikipedia.org/wiki/Query_string#URL_encoding -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
how do i access the passing variable in controller. i have done the passing variable part and when i use params[:variable_name] it gives error so could u please explain that a bit? nirosh -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 May 2010 03:29, nirosh <kunalan.kandiah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> how do i access the passing variable in controller. i have done the > passing variable part and when i use params[:variable_name] it gives > error > > so could u please explain that a bit?Look in the log to see what value is being passed in params, this will tell you whether it is accessing the value that is the problem or whether you are not getting into the params in the first place. If the value does not appear in the log look at the html of the page (View, Page Source or similar in the browser) and see whether the html is what you expect. If that still looks ok try pasting the html into the w3c online html validator to check the html is valid. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
it says that params[:variable_name] is nil.i tried several ways. but finally non of that working and gives the same nil output. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 May 2010 15:18, nirosh <kunalan.kandiah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it says that params[:variable_name] is nil.i tried several ways. but > finally non of that working and gives the same nil output.You have snipped all the original message so it is not clear what this is in response to. Are you replying to my suggestions? If so what have you found for each of them? Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.