[Rails] Re: Ajax - the Rails way!

2013-05-30 Thread Tommy Ng
Thanks Norbert! I read the document you recommended and here's my opinion: I found this document pretty good. However, there are a few things I'm not clear. Under the Putting it all together section, the author said enough explanation, let's create a remote form that loads some content

[Rails] Ajax - the Rails way!

2013-05-29 Thread Tommy Ng
I find the Rails online documentation at http://guides.rubyonrails.org/form_helpers.html#dealing-with-ajax; difficult to follow, due to the way the information is organized. For example, I wanted to look for Ajax, so I looked under View. But, because the material is organized in the MVC format,

[Rails] Re: Headache with Ajax in Rails using jQuery

2013-05-28 Thread Tommy Ng
Thanks a lot everyone! Masta, I did as you said: ... var values = $(#contactForm).serialize(); $.ajax({ url: /main/contact, type: post, data: values, success: function(data, textStatus, xhr){ alert(textStatus: + textStatus + ; xhr: + xhr + ; data: + data);

[Rails] Headache with Ajax in Rails using jQuery

2013-05-27 Thread Tommy Ng
Hello everyone, I'm a newbie at Ruby on Rails. I spent nearly two days of the Memorial Day weekend stumbling upon making Ajax working in Rails. At this point, I'm so exhausted and hope that I can get some help to move forward. I have tried nearly everything I found on Google but still not

[Rails] Re: Headache with Ajax in Rails using jQuery

2013-05-27 Thread Tommy Ng
Thanks unknown. Now that I already went down the jQuery path for Ajax, I would like to stick with it for a while. I'm most concerned about this portion of my code: def contact name= params[:name] message = params[:message] respond_to do |format| format.html # contact.html.erb