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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:17:59+00:00 2026-06-07T11:17:59+00:00

Suppose I have a ruby hash : person={:name=>:Alex,:age=>10} I wish I could call an

  • 0

Suppose I have a ruby hash :

person={:name=>:Alex,:age=>10}

I wish I could call an API like this:

db.save :people, person

which will execute the following SQL on mysql database:

insert  nto people (name,age) values ('Alex',10)

Is this possible by using rails or other ruby gems?

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

    You can call ClassName.create!(your_hash), so in your scenario it would look like this:

    Person.create!(person) # to create a record right away
    

    or

    person = Person.new(person) # to initialize the object first
    
    person.save #  and then save it
    

    No need to use any external gems, this is standard ActiveRecord, one of the Rails core libraries.

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

Sidebar

Related Questions

Suppose I have the global method hello(name) and an instance method hello like this:
Suppose we have the name written in any none-latin letters - languages, like Arabic,
Suppose I have this array of hashes: [ {href=>https://company.campfirenow.com, name=>Company, id=>123456789, product=>campfire}, {href=>https://basecamp.com/123456789/api/v1, name=>Company,
My Question Suppose I have a directory structure like this: app/ core/ bin/ runner
Suppose I have a class in Ruby: class Test def method(arg1, arg2) return arg1+arg2
Suppose you have the following file: textfield,datetimefield,numfield foo,2008-07-01 17:50:55.004688,1 bar,2008-07-02 17:50:55.004688,2 The Ruby code
Suppose I have a Ruby ERB template named my_template.html.erb , and it contains the
Languages that have closures, such as Ruby, enable elegant constructs to transform lists. Suppose
Suppose I have this structure: <one> <two> <three>3</three> </two> <two> <three>4</three> </two> <two> <three>3</three>
Let's suppose I have a very simple Ruby program: require 'rubygems' require 'ruby-debug' x

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.