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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:32:05+00:00 2026-05-30T20:32:05+00:00

This is about as beginner as a question gets, but I can’t find anything

  • 0

This is about as beginner as a question gets, but I can’t find anything in the ruby docs or on google that helps.

It’s a very simple question; how do I commit an ActiveRecord object to the database?

I have my user.rb file in models which just contains the two lines;

class User < ActiveRecord::Base
end

I have a users table in postgres that has only two fields, id and email.

And I have the following line in my signup controller;

User.new(:email => email)

It doesn’t kick an error so I assume that the new User object is created just fine, and that it’s happy about being given an ’email’ field, which leads me to believe that it is correctly reading its own field list from the database, but no record is created.

  • 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-05-30T20:32:06+00:00Added an answer on May 30, 2026 at 8:32 pm

    You can do two things to persist an object to the database:

    User.new(:email => email).save
    

    Or:

    User.create(:email => email)
    

    You’re right that this is a fairly beginnery question, but that’s nothing to be ashamed of! You should probably read the Ruby on Rails Getting Started Guide which introduces this and many more helpful concepts.

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

Sidebar

Related Questions

this is a total beginner question. My question is about data that you can
This question gets asked a lot, but I still haven't found a straight answer
I think this is probably a beginner question about big-O notation. Say, for example,
Q: This question is about how can i figure or select the convenient ORM
This stems from my question that i started at MVC Beginner Question Im now
This is a beginner's question, but I am interested in learning what's going on
This question about Timers for windows services got me thinking: Say I have (and
This is about a web app that serves images. Since the same request will
I know about this question: Which (third-party) debug visualizers for Visual Studio 2005/2008 do
While thinking about this question and conversing with the participants, the idea came up

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.