Ruby on Rails Monday, February 27, 2012



On Mon, Feb 27, 2012 at 4:52 PM, Vell <lovell.mcilwain@gmail.com> wrote:

Thanks for the quick response. That does give me a little more clarity
but I guess my question was how do I define my variable with a value
that is in params? When I do alert($("#params")) I get a response of
object Object. When I do alert($(form.serialize())), I seem to get
most of the params values except for the one that I want. It also
doesn't look like its in an array so I can't chose the element that I
want. Granted I am new to jquery and don't fully understand
serialization and a great many other things. I believe the first alert
is telling me that I can get to the entire params object using an id
of params. But how do I get to the value within it to be able to
specify my data variable in my $.ajax() statement?  Sorry If I am not
making much sense...


First of all, does #params is html? or you just put it there?  
maybe if you just put something like 

console.log($(form.serialize()));

and see what you're getting. (in chrome hit f12 and go to console, in firefox use firebug)

params is a hash of all the data you are sending, its handled by rails not as an html object


Javier Q.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment