Rails Database

A quick recap

MVC stands for Model, View, & Controller. The model represents the data. The view is what users get to see (html, css, javascript), and the controller is the backend that controls how the model is viewed.

Rails Database

Something we haven’t really talked about is Gems.

Todays Gem — Sqlite3

Sqlite3 is a database gem that allows you to store information. We are going to be using it in order to create users for our rails app.

$ rails g model User email:string password:string
$ rails c
$ > user = User.new(email: "abe@hello.com", password: "12345678")

Change User Information

$ > user.email 'abe@hello.com'
$ > user.email = "zebo@hello.com"
$ > user.email'zebo@hello.com'
def index 
@user = User.last
end

--

--

I write about holistic growth

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abe

Abe

I write about holistic growth