In this blog, we will be adding conditional rendering to the React App example from my previous blog, Build a Search Bar in React.js. We will be focusing on using…
This blog is for coders who have a basic understanding of Ruby on Rails.
Embedded Ruby a.k.a. ERB or eRuby is a template engine that embeds fragments of Ruby code into a text document. ERB is used in Ruby on Rails to show dynamic content on your website. The file extension for ERB is html.erb where you can write both HTML and Ruby code inside.
In this example, we have a Blogs_controller.rb file that contains a BlogsController which inherits from the ApplicationController and has an index action. The index action has a @blogs instance variable that…
This blog is for beginner coders who are learning Ruby.
The main use for the Map method in Ruby is to efficiently transform data. The Map method can be used with Arrays, Hashes, and Ranges. Below are some examples of how to use Map.
Within the curly braces is our block code. |n| represents each element in the array and each element will be multiplied by four. Map will transform the original array based on this block code and return a new array. The original array, however, will not be altered. Another name for Map is Collect. …
This blog is for people who have a basic understanding of react.js
In this blog, we are going to build a simple application in react.js that displays a search bar at the top and a list of flower names below, aka our fake data. The search bar will allow us to type into an input field that will search through our fake data and display the flower name(s) instantaneously on the screen. We will be using class based components to achieve this.
To create a new react project, run:
Remove all unnecessary files as highlighted below: