
Learning Rails 5
Rails from the Outside In
Publisher: O'Reilly Media
Release Date: August 2016
Pages: 452
Read on O'Reilly Online Learning with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything with O'Reilly Online Learning. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
If you’re a web developer or designer ready to learn Ruby on Rails, this hands-on guide is the ideal way to get started. Rather than toss you into the middle of the framework’s Model-View-Controller architecture, as many books do, Learning Rails 5 begins with the foundations of the Web you already know.
You’ll learn how to create something visible with Rails’ view layer before diving into the more difficult inner layers: the database models and controller code. All you need to begin your Rails journey is HTML experience. Each chapter includes exercises and review questions to test your understanding as you go.
- Present content by building an application with a basic view and a simple controller
- Build forms and process their results, progressing from simple to more complex
- Use Rails scaffolding and REST to build effective applications quickly
- Connect forms to models and create code that maps directly to database structures
- Build applications that combine data from multiple tables
- Use migrations to track changes to your database over time
- Add common elements such as sessions, cookies, and authentication
Table of Contents
-
Chapter 1 Starting Up Ruby on Rails
-
If You Run Windows, You’re Lucky
-
Getting Started at the Command Line
-
Starting Up Rails
-
Test Your Knowledge
-
-
Chapter 2 Rails on the Web
-
Creating Your Own View
-
What Are All Those Folders?
-
Adding Some Data
-
How Hello World Works
-
Adding Logic to the View
-
Test Your Knowledge
-
-
Chapter 3 Adding Web Style
-
I Want My CSS!
-
Specifying Stylesheets
-
Creating a Layout for a Controller
-
Choosing a Layout from a Controller
-
Sharing Template Data with the Layout
-
Setting a Default Page
-
Test Your Knowledge
-
-
Chapter 4 Managing Data Flow: Controllers and Models
-
Getting Started, Greeting Guests
-
Application Flow
-
Keeping Track: A Simple Guestbook
-
Finding Data with ActiveRecord
-
Test Your Knowledge
-
-
Chapter 5 Accelerating Development with Scaffolding and REST
-
A First Look at Scaffolding
-
REST and Controller Best Practices
-
Examining a RESTful Controller
-
Escaping the REST Prison
-
Test Your Knowledge
-
-
Chapter 6 Presenting Models with Forms
-
More Than a Name on a Form
-
Generating HTML Forms with Scaffolding
-
Form as a Wrapper
-
Creating Text Fields and Text Areas
-
Labels
-
Creating Checkboxes
-
Creating Radio Buttons
-
Creating Selection Lists
-
Dates and Times
-
Creating Helper Methods
-
Test Your Knowledge
-
-
Chapter 7 Strengthening Models with Validation
-
Without Validation
-
The Original Model
-
The Power of Declarative Validation
-
Managing Secrets
-
A Place on the Calendar
-
Beyond Simple Declarations
-
Test Your Knowledge
-
-
Chapter 8 Improving Forms
-
Adding a Picture by Uploading a File
-
Standardizing Your Look with Form Builders
-
Test Your Knowledge
-
-
Chapter 9 Developing Model Relationships
-
Connecting Awards to Students
-
Connecting Students to Awards
-
Nesting Awards in Students
-
Many-to-Many: Connecting Students to Courses
-
What’s Missing?
-
Test Your Knowledge
-
-
Chapter 10 Managing Databases with Migrations
-
What Migrations Offer You
-
Migration Basics
-
Inside Migrations
-
Test Your Knowledge
-
-
Chapter 11 Debugging
-
Creating Your Own Debugging Messages
-
Raising Exceptions
-
Logging
-
Working with Rails from the Console
-
Debug and Debugger
-
Test Your Knowledge
-
-
Chapter 12 Testing
-
Test Mode
-
Testing the Students App
-
Setting Up a Test Database with Fixtures
-
Model Testing
-
Controller Testing
-
Integration Testing
-
Beyond the Basics
-
Test Your Knowledge
-
-
Chapter 13 Sessions and Cookies
-
Getting Into and Out of Cookies
-
Storing Data Between Sessions
-
Test Your Knowledge
-
-
Chapter 14 Users and Authentication
-
The Sign-up Process
-
Wiring Authentication to Your Application
-
Classifying Users
-
More Options
-
Test Your Knowledge
-
-
Chapter 15 Routing
-
Creating Routes to Interpret URIs
-
Generating URIs from Views and Controllers
-
Infinite Possibilities
-
Test Your Knowledge
-
-
Chapter 16 From CSS to Sass
-
Getting Started
-
Sassy Style
-
Making Everything Work Together
-
Test Your Knowledge
-
-
Chapter 17 Managing Assets and Bundles
-
The Junk Drawer
-
Test Your Knowledge
-
-
Chapter 18 Sending Code to the Browser: JavaScript and CoffeeScript
-
Sending JavaScript to the Browser
-
Simplifying with CoffeeScript
-
Test Your Knowledge
-
-
Chapter 19 Mail in Rails
-
Sending Mail Messages
-
Previewing Mail
-
Receiving Mail
-
Test Your Knowledge
-
-
Chapter 20 Pushing Further into Rails
-
Changing to Production Mode
-
Deploying Is Much More Than Programming
-
Joining the Rails Ecosystem
-
-
Appendix An Incredibly Brief Introduction to Ruby
-
How Ruby Works
-
How Rails Works
-
Getting Started with Classes and Objects
-
Comments
-
Variables, Methods, and Attributes
-
Logic and Conditionals
-
-
Appendix An Incredibly Brief Introduction to Relational Databases
-
Tables of Data
-
Databases, Tables, and Rails
-
-
Appendix An Incredibly Brief Guide to Regular Expressions
-
What Regular Expressions Do
-
Starting Small
-
The Simplest Expressions: Literal Strings
-
Character Classes
-
Escaping
-
Modifiers
-
Anchors
-
Sequences, Repetition, Groups, and Choices
-
Greed
-
More Possibilities
-
-
Appendix Glossary
-
Speaking in Rails
-