Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

B. An Incredibly Brief Introduction to R... > Databases, Tables, and Rails

Databases, Tables, and Rails

For more than a decade, most web applications that used a database used Structured Query Language (SQL) to move information into and out of databases. SQL is a powerful tool for creating and manipulating database structures, as well as for moving information in and out of those structures, but it’s tightly focused on database projects only. You can’t build a complete web application using SQL, so historically developers have written the bulk of their applications in another language, and then made SQL calls against a database. Developers needed to know both SQL and the other language.

Rails changes all of this, taking the position that it’s better to manage data and logic in the same language, in this case Ruby. ActiveRecord abstracts the SQL calls away, though they still exist if you look through the development logs. At the same time, Rake and migrations handle the care and feeding of the database, defining and creating (or removing) tables. You define the tables in Ruby, and call rake db:migrate to make things happen.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial