Jump to ratings and reviews
Rate this book

Easy Active Record for Rails Developers: Master Active Record and Have a Ton of Fun Doing It!

Rate this book
About the Book
Easy Active Record for Rails Developers is the ultimate guide to building database-driven web applications using the powerful Active Record ORM. You'll follow along with the creation of ArcadeNomad, a fun location-based web application for retro arcade enthusiasts.

What You'll Learn
Properly validate, filter and manipulate your application’s model data
Integrate belongs_to, has_one, has_many, has_many through, and habtm model associations
Manage model schemas using Active Record’s powerful migrations tool
Create and integrate complex web forms
Deftly traverse associations using includes and joins
Monitor, debug and optimize your queries
Integrate user registration and authentication features

Table of Contents

Chapter 1. Introducing Models, Schemas and Migrations
In this chapter you’ll learn how to create the models used to manage the application’s business logic and provide convenient interfaces to the database, use migrations to create and evolve your database schema, and begin testing your models with RSpec and factory_girl.

Chapter 2. Loading, Validating and Manipulating Data
In this chapter you’ll learn how to load an initial data set into your application, create and manipulate data, enhance your application models using validators, and test your models with RSpec.

Chapter 3. Querying the Database
In this chapter you'll learn all about Active Record’s array of powerful query features, including how to execute queries, retrieve a specific record according to primary key, order, group, and limit results, retrieve random records, paginate results, and use scopes. You’ll also learn how to integrate these queries with controllers and views to create listing and detail pages.

Chapter 4. Introducing Associations
Thanks to a fantastic feature known as associations, defining and traversing table relations is a trivial task. In this chapter I’ll show you how to define, manage, and interact with the belongs_to, has_one, has_many, has_many :through, and the has_and_belongs_to_many associations.

Chapter 5. Mastering Web Forms
While creating simple forms is easy, things can get complicated fast when implementing more ambitious solutions such as forms involving multiple models. In this chapter I’ll go into detail regarding how you can integrate forms into your applications, covering both Rails’ native form building solutions as well as approaches offered by other gems.

Chapter 6. Debugging and Optimizing Your Application
While it’s fun to brag about your project’s cool features, they often come at great expense of your time and brainpower. Much of the effort was likely spent figuring out problems such as why a query was running slow or the reason a complex association wasn’t working as desired. In this chapter I'll introduce you to several tools and techniques that can automate much of the debugging and optimization process.

Chapter 7. Integrating User Accounts with Devise
There are quite a few moving parts associated with integrating even basic account features, including account registration, sign in, sign out, password recovery interfaces, and access restriction. Fortunately the Devise gem greatly reduces the amount of work otherwise required to implement account creation, authorization and management features, and in this chapter I’ll introduce you to this gem's many wonderful features.

About the Author

W. Jason Gilmore is a software developer, consultant, and bestselling author. He has spent much of the past 15 years helping companies of all sizes build amazing solutions. Recent projects include a Rails-driven e-commerce analytics application for a globally recognized publisher, a Linux-powered autonomous environmental monitoring buoy, and a 10,000+ product online store. Jason is cofounder of the CodeMash conference.

304 pages, Kindle Edition

First published September 13, 2014

3 people are currently reading
11 people want to read

About the author

W. Jason Gilmore

14 books5 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
4 (80%)
4 stars
0 (0%)
3 stars
1 (20%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for Maciej Czuchnowski.
9 reviews
July 15, 2018
This is easily the best Ruby on Rails book that I have ever read. I wish I had it when I was starting my web development career. Other sources don't read as easily as this one. Jason has a knack for explaining complicated things in a very approachable manner and you can see that he is passionate about it.

The only downside is the fact that it's no longer up to date with Rails 5 and probably never will be.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.