© Brady Somerville, Adam Gamble, Cloves Carneiro Jr and Rida Al Barazi 2020
B. Somerville et al.Beginning Rails 6https://doi.org/10.1007/978-1-4842-5716-6_14

14. Active Model

Brady Somerville1 , Adam Gamble2, Cloves Carneiro Jr.3 and Rida Al Barazi4
(1)
Bowling Green, KY, USA
(2)
Gardendale, AL, USA
(3)
Hollywood, FL, USA
(4)
FONTHILL, ON, Canada
 

We learned in previous chapters that Active Record gives us the tools we need to perform a variety of activities on our models. For example, we added validations to our User model to make sure email addresses are unique and valid. We also added a callback to our Comment model to email the article’s author anytime a comment is created. We were able to pass instances of these models to the form_with helper in their ...

Get Beginning Rails 6: From Novice to Professional 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.