Search Algorithms allow us to solve a specific search problem, and retrieve information from the database.
There are many ways to do so, some are faster than others, some are better in some situations but not in others, so which search algorithm should we use?
It depends on two values that describe the performance of the algorithms in terms of run time:
Big O notation (O): how much time does it take to the program to run at max (in the worst possible scenario)
Big Omega notation (Ω): in the best scenario, how many steps does it take to the…
As shown in the example below, we can make things happen when we hover onto something with our cursor, for example we can change the color of a particular word, or section.
However, when we move away from that particular word or section, its style doesn’t automatically change to what it was before, unless we tell it to. …
ActiveRecord methods described in this article: create, new, assign_attributes, save, update, build, pluck, where, find_by, find
Returns a new object and saves it to the database. The new object can be created from a hash, a block, or with attributes manually set after creation.
lucy = Dog.create(name: "Lucy", age: 4, :breed "Dalmatian")
When using a form to get the attributes’ values from the user, to create a new instance you can pass in those attributes using strong parameters, a hash of key, value pairs. Strong parameters permit the user to define just the given attributes, and nothing more.
During my first week at Flatiron as a Software Engineering student, I was introduced to Object Oriented Programming, a very important topic, that can be a bit complicated for beginners.
I’d like to spend a few minutes explaining the One-to-Many relationship, with the hope that this article can help other new developers in the future.
If we consider Objects in Ruby like things in real life, we can easily see how they are related and connected to one another, and I will illustrate this relationship with an example.
A dog belongs to an owner: the dog has one owner, and…