Home > Uncategorized > A Rails Question

A Rails Question

November 20th, 2008

One of our project students has a weird problem with Rails — if you have an answer (weird or otherwise), we’d like to hear from you.

  • I want to send an AJAX request to the server using POST.
  • Rails is supposed to handle parameter passing, placing all parameters in the params hash.
  • When I use Ajax.Request using POST, the variables that I’m passing are not reaching the params hash.
  • It works with GET though!

If I do:

render :text => request.inspect

I can see my POST parameters in @parameters in the request object, but somehow these aren’t making it to my params hash.

And here’s the kicker: parameters pass just fine on my partner’s laptop. So I’ve pinned it down to either a problem with my Rails installation, or a problem with my version of OLM. A complete purge and reinstall of Rails hasn’t helped. Neither has a complete reload of the code from the repository.

Later: problem solved — it was Firebug’s fault.

Uncategorized

  1. November 21st, 2008 at 05:03 | #1

    Any chance you are being redirected from, say, example.com to http://www.example.com by the web server? This strips off any POST parameters invisibly. Or, it could be an issue with Rails’ AJAX security measures.

  2. Jonathan
    November 22nd, 2008 at 22:54 | #2

    This sounds like a perfect Question to ask on Stackoverflow.com

    where I’m just a user.

  3. Mike
    November 23rd, 2008 at 16:10 | #3

    Problem solved! I was using an older alpha version of Firebug 1.2.1. It was capturing the AJAX POST request, but wasn’t letting the parameters through. Updated to latest Firebug, and problem is solved.

    Thanks Greg, Ana,

    -Mike

Comments are closed.