Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8568681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:09:55+00:00 2026-06-11T18:09:55+00:00

I am building an iOS app and it needs to post to a RoR

  • 0

I am building an iOS app and it needs to post to a RoR API.

To test the POST, I am running this command:

curl -d @/tmp/data localhost:3000/api/ratings

Where /tmp/data contains an array of hashes:

[    {        "uid": "gilt_162929239",        "rate": 1    }   ]

In Ruby, params looks like this:

[1] pry(#<Api::PromotionRatingsController>)> params
=> {"    {        \"uid\": \"good_162929239\",        \"rate\": 1    }   "=>nil,
 "format"=>"json",
 "action"=>"create",
 "controller"=>"api/ratings"}

How do I get Rails to create the array of hashes for me to iterate over with each?

Edit: I see I was missing headers.

Adding to the curl command line:

--header "Accept: application/json" --header "Content-type: application/json"

Now, here are my params:

[1] pry(#<Api::PromotionRatingsController>)> params
=> {"_json"=>[{"uid"=>"good_162929239", "rate"=>1}],
 "format"=>"json",
 "action"=>"create",
 "controller"=>"api/ratings",
 "promotion_rating"=>{"_json"=>[{"uid"=>"good_162929239", "rate"=>1}]}}

Still not right.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:09:56+00:00Added an answer on June 11, 2026 at 6:09 pm

    According to this:

    if you’ve turned on config.wrap_parameters in your initializer or
    calling wrap_parameters in your controller, you can safely omit the
    root element in the JSON/XML parameter. The parameters will be cloned
    and wrapped in the key according to your controller’s name by default.

    So, my guess is that you either need to include a root element, or set config.wrap_parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app I am building in iOS, version 5. This app is
I'm building an iOS app which needs real-time updates from the server, and I'd
I am building an iOS app using Appcelerator and the build in Facebook API
I'm building an iOS app, and part of the functionality is that it needs
When we are building html5 web app or ios hybrid app,we need to make
I am building a ios app for ipad, in which the user will be
I'm building an iOS app and I have all the functionality going already so
Hey so I'm building an iOS app. The fist window is a login screen
I am building a photo sharing app for iOS 5 and I'd like to
I am building an assistive iOS app for a kid that uses a switch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.