Color App - Part 3 - Rails Console & Input Validation

Published: 17 February 2023
on channel: SwiftRuby
318
8

In this lesson we will learn how to use rails console which is an interactive way to engage with our postgresql database from the command line. simply run the following from the command line to open up the rails console:

$ rails console

Next, we will explore input validation. We will modify color.rb which is our model to achieve input validation within our rails application.

In this video lesson we will learn how to use rails console. Rails console gives us an interactive way to engage with our postgresql database from the command line. Simply run the following from the command line to open up the rails console:

$ rails console

Next, we will explore input validation. We will modify color.rb which is our model to achieve input validation within our rails application.

/app/models/color.rb

validates :name, presence: true, uniqueness: true, length: { in: 2..14 }


Watch video Color App - Part 3 - Rails Console & Input Validation online without registration, duration hours minute second in high quality. This video was added by user SwiftRuby 17 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 318 once and liked it 8 people.