I want to create a new object, pass some initial values ββto it, and then save in db and return the saved object.
How can i do this?
Example:
What is the ruby ββway to do this?
user = User.create(:user_age => 35)
This will initialize the new object, set the user_age attribute to 35, save it in the database, and return the User object that represents this entry in the database.
user_age
User