7

Handling User Input outside of Models

In this chapter, we’ll continue discussing abstractions related to Rails models. This time, we will talk about user-driven operations and the corresponding design patterns. First, we’ll talk about modifying operations (creating or updating models) and introduce the concept of a form object, which is an object representing a user interface form in the code base. Then, we’ll discuss how to read (or filter) data based on user-provided parameters with the help of filter objects.

You will learn how to identify functionality that can be moved to form and filter objects, so you can introduce new abstraction layers and reduce the responsibility of the existing ones (especially the model layer).

We will cover the ...

Get Layered Design for Ruby on Rails Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.