I am trying to debug an ActiveResource call that is not working.
What’s the best way to view the HTTP response to the request ActiveResource is making?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s easy. Just look at the response that comes back. 🙂
Two options:
puts response.inspectat the appropriate place. Remember to remove it.Here’s a silly example of the latter option.
Imagine the first class definition is in the ActiveRecord source files. The second class definition is in your application somewhere.
You can see that it prints it and then returns it. Neat, huh?
(And although my simple example doesn’t use it since it isn’t using Rails, check out
alias_method_chainto combine your alias calls.)