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 8944095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:57:00+00:00 2026-06-15T11:57:00+00:00

Here is the .ajax call. The variable questions is a JSON object: Object {question_1:

  • 0

Here is the .ajax call. The variable questions is a JSON object:

Object {question_1: "3", question_2: "6", question_3: "9", question_4: "15", question_5: "12"}

    $.ajax({
      type: "POST",
      url: "/save",
      data: questions,
      dataType: 'json',
      contentType: 'application/json',
      success: function (data) {
        alert('success');
      }
      });

My ruby contorller.

def save
 # How do I access the data object?
end

Do I just do a params[:data] or params[:questions] ?

Thanks and while I found other questions similar to this, none mentioned what the actual parameter name is called.

  • 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-15T11:57:02+00:00Added an answer on June 15, 2026 at 11:57 am

    It’s whatever you’ve made the questions variable. If you’ve included a root object

    {"question": { ... }}
    

    It’ll be accessible at params[:question]

    Otherwise the attributes will be included in the root of the params hash along with anything Rails adds and the URL attributes.

    By the by, I would expect the data in a variable called questions to look something like this:

    { "questions": [{ ... }, { ... }]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my ajax call: $.ajax({ url: 'url-to-json', type: 'POST', dataType: 'json', cache: 'false', data:
Here is how I am submitting my ajax request : $.ajax({ url: myurl, type:
I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,
I am doing an AJAX call that returns some HTML and jQuery: <div id='selected'>Here
I am getting an error in an ajax call from jQuery. Here is my
How to get array data from json in c#? Here is the ajax code
call to split on a variable causes a Object doesn't support this property or
I am making an ajax call with jquery like: $.ajax({ url: path/to/webservice.asmx beforeSend: function(xmlHTTPRequest)
I have the following jQuery script: $(document).ready(function() { $.ajax({ url: 'temp.ajax.php', type: 'GET', success:
My project requires polling a certain URL for a JSON response, using AJAX. The

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.