New to Ruby: Databases?

I have no programming experience prior to learning Ruby, and I have
learned from reading Chris P.'s Learn to Program and referencing to
http://www.ruby-doc.org/docs/ProgrammingRuby/

I am developing two websites http://bluebottleimages.rubidot.com/ and
http://partysushi.com/ using eruby and rhtml templates.

I have a vague idea of what a database is.
what is a database for? and what is the advantage over using basic IO to
read/write .txt files or something? Do I have to learn Rails to use a
database? and how can I learn to create/use them?

Jonathan D. wrote:

I have no programming experience prior to learning Ruby, and I have
learned from reading Chris P.'s Learn to Program and referencing to
Programming Ruby: The Pragmatic Programmer's Guide

I am developing two websites http://bluebottleimages.rubidot.com/ and
http://partysushi.com/ using eruby and rhtml templates.

I have a vague idea of what a database is.
what is a database for? and what is the advantage over using basic IO to
read/write .txt files or something? Do I have to learn Rails to use a
database? and how can I learn to create/use them?

Databases store and retrieve sets of records. Take a look at the menu
page for your partysushi page. Each roll has a title, a picture and a
description. In the language of databases the menu would be a table.
Each roll would be a row. each row has 3 fields: picture, title, and
description. With Rails you can easily do 4 different types of
operations on these rows:

Create: (The cheif invents a new roll and wants it on the menu ASAP)
Read: (No more messy IO.Readlines to deal with)
Update: (Change the picture on the Spedo roll to include the Cheif in
his swimsuit)
Destroy: (Get rid of the Lemon Curry roll no one likes it)

Note: the acronym CRUD is used to refer to all these.

Rails will help you to make you site more dynamic and is IMHO easier to
learn then the Rails IO classes.

Check out one of the Getting Started Guides.

John M.

Sorry for the late reply. I just wanted to say thanks for the help and
really good explaination :slight_smile:

haha… CRUD
there’s gotta be some secret society dedicated to making horrible
acronyms for science and technology. :wink: