Forum: Ruby on Rails New to Ruby: Databases?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7c8f1ac636d1e3ed78c4e3797312b8df?d=identicon&s=25 Jonathan Denni (bluebottle)
on 2007-04-04 09:22
I have no programming experience prior to learning Ruby, and I have
learned from reading Chris Pine'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?
E811b5337bcad19d52c8fed3a0ea0075?d=identicon&s=25 John Miller (jfmiller28)
on 2007-04-04 20:47
Jonathan Denni wrote:
> I have no programming experience prior to learning Ruby, and I have
> learned from reading Chris Pine'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?

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 Miller
7c8f1ac636d1e3ed78c4e3797312b8df?d=identicon&s=25 Jonathan Denni (bluebottle)
on 2007-04-12 08:34
Sorry for the late reply.  I just wanted to say thanks for the help and
really good explaination :)

haha... CRUD
there's gotta be some secret society dedicated to making horrible
acronyms for science and technology. ;)
This topic is locked and can not be replied to.