Preface
1. Version Selection and Installation
1.1. Ruby in Version 1.8.x, 1.9.2 or 1.9.3?
1.2. Rails 2.x or 3.x?
1.3. Difference Between Production System and Development System
1.4. Mac OS X 10.7 - Installation of Ruby on Rails 3.2 with RVM
Xcode Installation or Upgrade
Installing Ruby 1.9.3 with RVM
Generate Ruby Documentation
Installing Rails
And Now?
1.5. Debian 6.0 (Squeeze) - Installation of Ruby on Rails 3.2 with RVM
Preparations
Installing Ruby 1.9.3 with RVM
Generate Ruby Documentation
Installing Rails
And Now?
1.6. Ubuntu 12.04 LTS - Installation of Ruby on Rails 3.2 with RVM
Preparations
Installing Ruby 1.9.3 with RVM
Generate Ruby Documentation
Installing Rails
And Now?
1.7. Windows - Installation of Ruby on Rails 3.2
And Now?
2. Ruby Basics
2.1. Introduction
2.2. A Scripting Language
2.3. Hello World
puts and print
Comments
Help via ri
2.4. irb
Comments in irb
2.5. Ruby is Object-Oriented
Methods
Classes
2.6. Variables
Naming Conventions
Strings
Integers
Boolean Values and nil
Scope of Variables
2.7. Methods Once Again
Getters and Setters
Built-In Methods for String
Method Chaining
Converting from One to the Other: Casting
Method to_s for Your Own Classes
Is + a Method?
2.8. if-Condition
Shorthand
else
elsif
2.9. Loops
while and until
Blocks and Iterators
2.10. Arrays and Hashes
Arrays
Hashes
2.11. Miscellaneous
Range
3. First Steps with Rails
3.1. Introduction
Environment (Development)
Why Is It All in English?
3.2. Static Content (HTML and Graphics Files)
Create Rails Project
Static Pages
3.3. Creating HTML Dynamically with erb
Programming in an erb File
Layouts
Passing Instance Variables from a Controller to a View
Partials
3.4. Redirects
3.5. Flash Messages
Different Types of Flash Message
Different Syntaxes
Why Are There Flash Messages At All?
3.6. The Rails Console
3.7. Misc
"Model View Controller" Architecture (MVC)
What is a Generator?
Helper
DRY - Don't repeat yourself
Convention Over Configuration
4. ActiveRecord
4.1. Howto for this Chapter
Not in the Mood for SQL?
Taste Blood
4.2. Creating Database/Model
The Attributes id, created_at and updated_at
Possible Data Types in ActiveRecord
Naming Conventions (Country vs. country vs. countries)
Database Configuration
4.3. Adding Records
create
new
new_record?
4.4. first, last and all
4.5. Populating the Database with seeds.rb
It's all just Ruby code
Generating seeds.rb From Existing Data
UTF-8
4.6. Searching and Finding with Queries
find vs. where
find
where
exists?
order and reverse_order
limit
group
pluck
Calculations
SQL EXPLAIN
4.7. Editing a Record
Simple Editing
changed?
update_attributes
Locking
4.8. has_many – 1:n Association
Creating Records
Accessing Records
Searching For Records
delete and destroy
Options
4.9. Many-to-Many – n:n Association
Preparation
The Association
Logically, the Association Works Like has_many
4.10. has_one – 1:1 Association
Preparation
Association
Console Examples
has_one vs. belongs_to
4.11. Polymorphic Associations
4.12. Removing a Record
destroy
delete
4.13. Transactions
4.14. NamedScopes
Preparation
Simple NamedScopes
Lambda
Passing Parameters
Creating New Records with NamedScopes
4.15. Validation
Preparation
The Basic Idea
presence
length
numericality
uniqueness
inclusion
exclusion
format
General Validation Options
Writing Custom Validations
Further Documentation
4.16. Migrations
Which Database is Used?
Creating Index
Miscellaneous
Further Documentation
4.17. Miscellaneous
Callbacks
Default Values
5. Scaffolding and REST
5.1. Introduction
5.2. Generating a Scaffold
Creating the Database with Sample Data
The Routes
The Controller
The Views
5.3. When Should You Use Scaffolding?
Example for a Minimal Project
Conclusion
6. Routes
6.1. Introduction
6.2. get
6.3. Names of Routes
:as
6.4. root :to => 'welcome#index'
6.5. match
Parameters
Constraints
Redirects
6.6. resources
Selecting Specific Routes with :only or :except
Nested Resources
6.7. Further Information on Routes
7. Tests
7.1. Introduction
7.2. Example for a User in a Web Shop
Functional Tests
Unit Tests
7.3. Fixtures
Static Fixtures
Fixtures with ERB
7.4. Integration Tests
7.5. rake stats
7.6. More on Testing
8. Cookies and Sessions
8.1. Cookies
Permanent Cookies
Signed Cookies)
8.2. Sessions
Breadcrumbs via Session
reset_session
Saving Sessions in the Database
9. Action Mailer
9.1. Configuring the E-Mail Server
Sending via Local Sendmail
Sending via Direct SMTP
9.2. Custom X-Header
9.3. HTML E-Mails
9.4. Attachments
Inline Attachments
9.5. Further Information
10. Internationalization
10.1. Introduction
I18n.t
Localized Views
10.2. A Rails Application in Only One Language: German
Paths in German
10.3. Multilingual Rails Application
Using I18n.locale for Defining the Desired Language
Multilingual Scaffolds
10.4. Further Information
11. Bundler and Gems
11.1. Gems
11.2. Bundler
bundle update
bundle outdated
bundle exec
Further Information on Bundler
12. Asset Pipeline
12.1. Introduction
Manifest Files
rake assets:precompile
The Fingerprint
12.2. Coding Links to an Asset
Coding Link to an Image
Coding Link to a JavaScript File
Coding Link to a CSS File
Defaults in the application.html.erb
13. JavaScript
13.1. Introduction
jQuery
CoffeeScript
13.2. JavaScript Helpers
javascript_tag
link_to_function
button_to_function
13.3. JavaScript and CoffeeScript in the Asset Pipeline
Changing Form Depending on Input
14. Caching
14.1. Introduction
A Simple Example Application
Normal Speed of the Pages to Optimize
14.2. HTTP Caching
Last-Modified
Etag
Combining Etag and Last-Modified
The Magic of touch
stale?
Using Proxies (public)
Cache-Control With Time Limit
14.3. Page Caching
Activating Page Caching in Development Mode
Caching Company Index and Show View
Deleting Page Caches Automatically
14.4. Fragment Caching
Enabling Fragment Caching in Development Mode
Caching Table of Index View
Deleting Fragment Cache
Auto-Expiring Caches
Software Versioning and current_user
Cache Store
14.5. Preheating
15. Web Server in Production Mode
15.1. Introduction
Debian 6
15.2. Basic Installation Web Server
Buildsystem
Node.js
nginx
Creating User Deployer
Create Directory Structure
Setting up Rails Environment for User Deployer
Database
Installing Memcache
15.3. Webserver Without Deployment
Setting Up New Rails Project
Loading New Version of Rails Project
15.4. Web Server with Capistrano Deployment
Development System
Web Server
cap deploy:setup
Web Server Configuration
sudo
Deployment
15.5. Other Issues
What Else There Is To Do
404 and Co.
Multiple Rails Servers on One System
15.6. Cloud Platform as Service Provider
16. Tips and Tricks
16.1. Abbreviations
16.2. Templates
Scaffold Controller Template
Model Template
17. Acknowledgements
17.1. Boris Karnikowski
17.2. Editorial Office
Dominik Bamberger
Brigitte Hamerski
17.3. Ruby and Rails Rockstars
17.4. Helpers
17.5. Twitter
17.6. Readers
A. Further Rails Documentation
A.1. Online
Index

Updates about this book will be published on my Twitter feed.