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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:03:29+00:00 2026-06-17T08:03:29+00:00

In the model i have like, def question_hash_string @question_hash_string || ‘{}’ end def question_hash

  • 0

In the model i have like,

  def question_hash_string
    @question_hash_string || '{}'
  end

  def question_hash
    ActiveSupport::JSON.decode question_hash_string
  end

In the Javascript,

var question_hash_element = document.getElementById('enr_rds_batch_update_question_hash_string');
var question_hash = JSON.parse(question_hash_element.value);

question_hash[batch_question_id] = (batch_answer_id || batch_rdsap_answer || batch_answer_checkbox);
question_hash_element.value = JSON.stringify(question_hash);

It would give the values like "{"16":"3","28":false}"

I want to add another value with the answer like the following,

question_hash[batch_question_id] = ((batch_answer_id || batch_rdsap_answer || batch_answer_checkbox) && (build_id));

"{"16":"3","28":false:"2", "3":"55":"54"}" and so on. I need to add another column with the existing record with ‘:’.

  • 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-17T08:03:29+00:00Added an answer on June 17, 2026 at 8:03 am

    Adding a key/value pair to a javascript object :

    var question_hash = { question_id:2, answer_id:3 };
    question_hash.build_id = 6;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, say I have models like this: class Foo(Model): name = CharField(max_length=200) def latest_comment(self):
I have a model, smth like this: class Action(models.Model): def can_be_applied(self, user): #whatever return
I have code like this in my view model: function ChatListViewModel(chats) { var self
I have a few places in a model that does stuff like def ServerInfo.starttime(param)
I have methods in all of my models that look like this: def formatted_start_date
I have model like this: scope :search_posts, lambda { |query| mega_posts.where( title LIKE ?
i've a problem with my tabularinline field. I have model like this class Product(models.Model):
I have a model like this: class Users(db.Model): email = db.EmailProperty(required=True, indexed=True) user_name =
I have a model like: CAMPAIGN_TYPES = ( ('email','Email'), ('display','Display'), ('search','Search'), ) class Campaign(models.Model):
I have entity model like this (using EclipseLink and JPA 2.0): @Entity class A

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.