Ruby on Rails Monday, February 27, 2012

Hello all,

I'm trying to write a jquery function where I am posting some data from a form. I am wondering is there a way to select the particular param that I want to use when I submit the data to $.ajax(). I don't believe it makes sense to create a hidden field just to use with $.ajax() but I can't seem to figure out how to get to the params key/value using jquery.

The code that I am attempting to use is:
$.ajax({
url: "/app/controller/action",
type: "POST",
data: {code : 'param[:value]' or ??}
});

Can this be done at all? if so, what would be a good approach?

Thanks,

--
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