Validations are used to ensure that only valid data is saved into your database. For example, it may be important to your application to ensure that every user provides a valid email address and mailing address.
There are several ways to validate data before it is saved into your database, including native database constraints, client-side validations, controller-level validations, and model-level validations:
The term API stands for Application programming interface. An API for a website is code that allows two software programs to communicate with each other.
API spells out the proper way for a developer to write a program requesting services from an operating system or other application.
The term REST stands for Representational State Transfer. It is an architectural style that defines a set of rules in order to create Web Services. …
React allows us to pass data from one component to another component using Props which stands for properties. The data can come in different forms: numbers, strings, arrays, functions, objects, etc.
Props can only be passed from parent to child components (uni-directional flow).
There are cases however, with the use of callback functions where props can be passed from a child to a parent component. Furthermore, data received from props is read-only and cannot be modified by a child component receiving it.
How do you pass data with props?
Here is an example of how data can be passed by…
These are 5 ways in which we can select elements in the DOM using selectors
These selectors are method of the document object. …
The routing module provides URL rewriting in native Ruby. It’s a way to redirect incoming requests to controllers and actions. It replaces the mod_rewrite rules. Best of all, Rails’ Routing works with any web server. Routes are defined in app/config/routes.rb.
Think of creating routes as drawing a map for your requests. The map tells them where to go based on some predefined pattern.
How to define a route
Rails.application.routes.draw doPattern 1 tells some request to go to one placePattern 2 tell them to go to anotherPattern 3 tell them to go to another…End