■ CONTENTS
xvi
Rails: Ruby’s Killer App ................................................................................................. 306
What Is Rails and Why Use It? ............................................................................................................306
Installing Rails ....................................................................................................................................309
Building a Basic Rails Application ......................................................................................................310
Controllers and Views .........................................................................................................................322
Models and Relationships...................................................................................................................327
Sessions and Filters ...........................................................................................................................329
Other Features ....................................................................................................................................330
Where to Go Next: References, Books, and Example Apps .................................................................332
Sinatra: Lightweight, Simple Web Applications ............................................................ 333
The Extreme Simplicity of Sinatra ......................................................................................................333
General URL Routing and Parameter Matching .................................................................................. 334
Views, Templates, and Static Files ......................................................................................................335
Request Flow Control .........................................................................................................................339
Summary ...................................................................................................................... 341
■Chapter 14: Ruby and the Internet .................................................................... 343
HTTP and the Web ........................................................................................................ 343
Downloading Web Pages ....................................................................................................................343
Processing Web Content .....................................................................................................................351
E-Mail ........................................................................................................................... 354
Receiving Mail with POP3 ...................................................................................................................354
Sending Mail with SMTP .....................................................................................................................356
Sending Mail with ActionMailer ..........................................................................................................357
File Transfers with FTP ................................................................................................. 358
Connection and Basic FTP Actions .....................................................................................................358
Downloading Files ..............................................................................................................................360
Uploading Files ...................................................................................................................................360
Summary ...................................................................................................................... 362