How To Use Rails Console To Test Rails Models, Associations and Validations

Written by elukoye | Published 2020/06/11
Tech Story Tags: rails | ruby-on-rails | ruby | microverse | education | beginners | programming | backend | web-monetization | hackernoon-es

TLDR Using the rails console is an irb session that is built into the rails environment and is accessed by typing rails c into the terminal. It can be used to test association methods, validations and check error messages when building a rails app. A good tool to use is LUCID to help developers design their apps for their apps. We are going to build a blog with two models, a user with a name attribute and an article with a title attribute and a body attribute. Let’s build a sample blog app to see how it works.via the TL;DR App

no story

Written by elukoye | I work at the intersection of people, processes, and tech — building platforms that are reliable, secure, and user-friendly.
Published by HackerNoon on 2020/06/11