Search code examples
ruby-on-rails-3restparametersactiveresource

Showing POST parameters in Rails ActiveResource


I am using ActiveResource to get and post resources from an external API. Even though that in the logs I can see the calls that are being performed, I fail to see the params. Shouldn't the params hash be printed by default?

How/what should I add to be able to see them?


Solution

  • ActiveResource Post call syntax is:

    post(your_custom_method_name, options={}, body='')
    

    Here options is query parameter

    Ex:

    Customer.post(:bulk_import, {}, { new_customers: new_customers}.to_json)