teleren/devto huggingface dataset:
SQL Aggregate Product
Tags: todayilearned, sql, math
Published: 2020-12-24 17:24:36

Been left on CodeSignal for a while because I'm lately rushing for a full stack course~ [Today's task](https://app.codesignal.com/challenge/TC2YTqvN6Pd7yo9cp) appears to be simple but the solution is not equally simple. Indeed, I learnt my lesson. In brief, we are required to do an aggregated product in SQL. 

It turns out that such fundamental function is not supported in SQL. You may wanna ponder on it a bit. The hint is: simple "useless" math XD

When I look through the top 10 solutions, *ALL OF THEM* use exactly the same skill: 
{% collapsible Here is this famous workaround %} 
```SQL
SELECT EXP( SUM( LN( field ) ) ) | 0
FROM table
```
{% endcollapsible %}

Please suggest below if you come up with some other ways X)
Not recieved HacktoberFest2020 swag
Tags: hacktoberfest, discuss
Published: 2020-12-24 17:11:47

Its going to be the end of this year and I have still not received any update from DHL courier tracking  service about my HacktoberFest goodies. The last update was November 13th 2020 after that nothing was communicated. 
Please can anyone help me  what should I do here. Can you please provide email id so that I can forward my tracking number so that this gets resolved.

PS:- I am from India.

#hacktoberfest2020
Merry #JavaScriptmas
Tags: javascript
Published: 2020-12-24 17:07:27

24 Days of JavaScript challenges offered by [Scrimba](https://scrimba.com/), from December 1st to 24th counting down until Christmas.


JavaScript Challenges:
1. [🍬 Candies](https://scrimba.com/scrim/coe224e259049d471383dbcf5)
2. [⭐️ Deposit Profit](https://scrimba.com/scrim/co2bc443da1d86ffb763a3904)
3. [🧚 Chunky Monkey](https://scrimba.com/scrim/co7e4457fab3281466670d03e)
4. [🎄 Century From Year](https://scrimba.com/scrim/cob6441a09c5e2c1fb1af0a28)
5. [🐑 Reverse a String ](https://scrimba.com/scrim/co6ee4ad09226198176a0b730)
6. [🤶 Sort by Length](https://scrimba.com/scrim/cof6d417bbcfc2e5a387928b7)
7. [🦌 Count Vowel Consonant](https://scrimba.com/scrim/cofa04ad0926f89a6377908fb)
8. [🔔 The Rolling Dice](https://scrimba.com/scrim/co6d243b0b571a83e71ed49bf)
9. [🎺 Sum Odd Fibonacci Numbers](https://scrimba.com/scrim/co2844cafb9a957fda4264166)
10. [💂 Adjacent Elements Product](https://scrimba.com/scrim/co2ab4e1bb8d3eef9d0f6cb7e)
11. [🎁 Avoid Obstacles](https://scrimba.com/scrim/co42544b3ae310a08d3da03e8)
12. [❄️ Valid Time](https://scrimba.com/scrim/co023493095f02b1f0e0ef40b)
13. [🤴 Extract Each Kth](https://scrimba.com/scrim/co51f4188b1a2a384d424e312)
14. [🧸 Maximal Adjacent Difference](https://scrimba.com/scrim/co4794d9f97d9873b30fa351d)
15. [🕊 Carousel](https://scrimba.com/scrim/co8a440e5b2b88118a9aef37f)
16. [🧦 Insert Dashes](https://scrimba.com/scrim/co29c4ca7b7ef4433d28f68cb)
17. [👑 Different Symbols Naive](https://scrimba.com/scrim/cob8e47e7a537605bbfac9f6e)
18. [🎅 Array Previous Less](https://scrimba.com/scrim/co8c14cf0b9f51ed59e31d310)
19. [🐫 Alphabet Subsequence](https://scrimba.com/scrim/co1f841f480fdce2b71f7f169)
20. [✨ Domain Type](https://scrimba.com/scrim/coebe46b1b396602f3ac41065)
21. [🦃 Sum of Two](https://scrimba.com/scrim/co2f94659bc3d7ec3ded0b006)
22. [👼 Extract Matrix Column](https://scrimba.com/scrim/co79b4c7792fa16c7bf47e1bf)
23. [🌠 Social Media Input](https://scrimba.com/scrim/coc834326a03fbd11d8c81817)
24. [🧐 Test Your Agility](https://scrimba.com/scrim/cof81432c972df11c346b0a2b)
Build a Python Flask API for your Delta Lake
Tags: deltalake, deltars, rust, python
Published: 2020-12-24 16:55:03

After the recent announcement on the Databricks blog about [querying your Delta Lake natively with Python](https://databricks.com/blog/2020/12/22/natively-query-your-delta-lake-with-scala-java-and-python.html) (and other languages) without Apache Spark, I got curious about how a Flask API endpoint would look like, so here it is.

```
from deltalake import DeltaTable
from flask import request, jsonify

app = flask.Flask(__name__)
app.config["DEBUG"] = True

@app.route('/read-delta-table', methods=['GET'])
def home():
    dt = DeltaTable("/tmp/delta/students-delta-table/")

    pd = dt.to_pyarrow_dataset().to_table().to_pandas()

    json_str = pd.to_json(orient = "records")

    parsed = json.loads(json_str)  

    return jsonify(parsed)

app.run()
```
[Gist](https://gist.github.com/francisco-ltech/05e944e52f7ca5c51bce927773a91dd0#file-deltalake-api-endpoint-py)

**Running the API**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/raw797x8lskcvnw6zsuz.png)


**Pre-requisites:**
1. In order to compile the code you need to use the nightly version of rust

    [to install]
    `$ rustup toolchain install nightly`

    [to use]
    `$ cd ~/projects/needs-nightly`
    `$ rustup override set nightly`

2. You need to use maturin package to build the .whl

    $ pip install maturin
    $ maturin build

This is still an experimental interface to Delta Lake for Rust with native bindings for Python so proceed with caution, you wouldn't want to expose an ocean of data through an endpoint so proceed with caution.

I'm excited about this project, being able to query delta tables from front-end apps (not via Apache Spark) was a missing piece in the puzzle of delta lakes.

Fantastic effort by the delta-rs contributors:
* [QP Hou](https://github.com/houqp)
* [R. Tyler Croy](https://github.com/rtyler)
* [Ben Sully](https://github.com/sd2k)

Delta-rs Git repo is [here](https://github.com/delta-io/delta-rs)
AWS Cloud Shell Quick Tips
Tags: aws
Published: 2020-12-24 16:47:21

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/76m07jf9gb2ercuq0v0b.png)

AWS [Cloud Shell](https://aws.amazon.com/cloudshell) is a great new tool - here are some tips:

1. Use the `--cli-auto-prompt` flag to enable aws cli command autocomplete in Cloud Shell (shown above)

2. To switch to a new shell, enter the shell's program name at the command line prompt - `bash`: Bash; `pwsh`: PowerShell; or `zsh`: Z shell

3. Click on the `Actions` menu > `Tab Layout` to add and align one or more additional windows

4. Click on the `Actions` menu > `Files` to upload or download a file to/from your current session

5. Many common tools and runtimes are [pre-installed](https://docs.aws.amazon.com/cloudshell/latest/userguide/vm-specs.html), these include the ones listed below.

#### Tools 
* bash, powershell, zsh
* aws cli, ecs cli, sam cli
* node, npm, python3
* git, sudo, tar, vim, wget, unzip/zip
All my #Javascriptmas challenge solutions
Published: 2020-12-24 16:36:47

---
title: All my #Javascriptmas challenge solutions
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Here all my solutions of #Javascriptmas Challenge

01/24 - [Challenge 01](https://scrimba.com/scrim/co4f84d919e299783352b96d0)
02/24 - [Challenge 02](https://scrimba.com/scrim/coa07460e9a6a6dd84f1aa56c)
03/24 - [Challenge 03](https://t.co/UIMd6cTcm9)
04/24 - [Challenge 04](https://t.co/ZKZvXmaRtZ)
05/24 - [Challenge 05](https://scrimba.com/scrim/co71f46d09442260ded73452a)
06/24 - [Challenge 06](https://t.co/6opejprefz)
07/24 - [Challenge 07](https://t.co/KVDfgttXrS)
08/24 - [Challenge 08](https://t.co/hk3tatRQmM)
09/24 - [Challenge 09](https://t.co/Rsd2JJEE70)
10/24 - [Challenge 10](https://t.co/hDqKrPXYcx)
11/24 - [Challenge 11](https://t.co/HTg5mA3C5N)
12/24 - [Challenge 12](https://t.co/V2Pcf4ZEfW)
13/24 - [Challenge 13](https://t.co/ogSfTBgLoV)
14/24 - [Challenge 14](https://t.co/566I9xx72t)
15/24 - [Challenge 15](https://t.co/nkanH67eF1)
16/24 - [Challenge 16](https://t.co/7v1QpTwhTH)
17/24 - [Challenge 17](https://t.co/UqeIjOcXMu)
18/24 - [Challenge 18](https://t.co/CvuJQSExfn)
19/24 - [Challenge 19](https://t.co/iwUtGMunwm)
20/24 - [Challenge 20](https://t.co/4UJUgOaoyn)
21/24 - [Challenge 21](https://t.co/gvVOffbYQr)
22/24 - [Challenge 22](https://t.co/CrPka8xVJ4)
23/24 - [Challenge 23](https://t.co/tcjF8ZMo78)
24/24 - [Challenge 24](https://t.co/Mmc8ehe2hT)
YouTube Video | ReactJS Tutorial for Beginners -12
Tags: react, webdev, show, youtube
Published: 2020-12-24 16:18:01

We will learn about Pure components and Memo, in this part.

{% youtube uM-QKVnU0AE %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -11
Tags: react, webdev, showdev, youtube
Published: 2020-12-24 16:16:01

We will learn about all the lifecycle methods, available in class based components.

{% youtube Yoa8q-YzdKA %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -10
Tags: react, youtube, webdev, showdev
Published: 2020-12-24 16:14:15

We will learn to do React form handling in this part.

{% youtube SV7Nj-YI-40 %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -9
Tags: react, webdev, showdev, youtube
Published: 2020-12-24 16:12:25

In this video, we will learn to style React Components.

{% youtube 8fsCL7ikE44 %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
Webpacker 6: Troubleshooting Guide
Tags: rails, webpacker, tutorial, debugging
Published: 2020-12-24 16:12:01

A (growing) collection of tools and techniques for debugging your Webpack(er) setup. 

I highly recommend reading the [SurviveJS - Webpack 5 ebook for a real deep dive!][2].

## Locating the Issue

Use the network tab in your browser to view the CSS that’s being sent to the browser for clues.

## Cached Styles

If you update your styles but your UI does not change and there are no errors, it’s likely browser caching.

Hard reload after clearing your cache and you should see your changes.

To avoid these errors, import your styles into your JS pack vs. using `style-loader`.

## Tools

### Dashboards

- [Webpack-Dashboard][1]

[1]: https://github.com/FormidableLabs/webpack-dashboard "Webpack-Dashboard"
[2]: https://survivejs.com/webpack/foreword/ "SurviveJS - Webpack 5 ebook for a real deep dive!"
Webpacker 6: Tailwind CSS 2.0 Integration
Tags: rails, webpacker, tailwindcss, tutorial
Published: 2020-12-24 16:11:42

In order to add Tailwind CSS 2.0 to your Rails 6 + Webpacker 6 application, you need PostCSS set up, plus a few additional steps.

Tailwind CSS has [detailed documentation on preprocessor usage][1] so refer to that for further setup.

> Note: This section builds on the PostCSS section

## Install

```bash
yarn add tailwindcss
```

### Add Tailwind CSS Config File

```bash
yarn tailwind init
```

### Update PostCSS Config

```diff
// postcss.config.js

module.exports = {
  plugins: [
    require('postcss-import'),
+   require('tailwindcss'),
    require('autoprefixer')
  ]
}
```

## Usage

**You should be able to use the same pack tag that you added for CSS.**

Make sure you restart `bin/webpack-dev-server` after installing new loaders.

### Style Loader Example

```diff
<%# app/views/layouts/application.html.erb %>

+ <%= stylesheet_packs_with_chunks_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
```

### Extract Example

```diff
<%# app/views/layouts/application.html.erb %>

<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
+ <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
```

```diff
// app/javascript/packs/application.js

+ import "./application.css"
```

## Verify

> Note: Make sure you restart the dev server!

Let’s create a new PostCSS file:

```bash
touch app/javascript/stylesheets/base.css
echo "@import 'tailwindcss/base';" >> app/javascript/stylesheets/base.css
touch app/javascript/stylesheets/utilities.css
echo "@import 'tailwindcss/utilities';" >> app/javascript/stylesheets/utilities.css
touch app/javascript/stylesheets/components.css
echo "@import 'tailwindcss/components';" >> app/javascript/stylesheets/components.css
```

Next, add some CSS:

```diff
/* app/javascript/stylesheets/base.css */

@import "tailwindcss/base";

+ h1 {
+   font-size: 2.2em;
+   color: #2563eb;
+ }
+
+ p {
+   font-size: 1.2em;
+ }
```

Lastly, update `application.css`:

```css
/* app/javascript/packs/application.css */

@import "../stylesheets/base.css";
@import "../stylesheets/components.css";
@import "../stylesheets/utilities.css";
```

Reload your browser and your styles should be applied now with Tailwind CSS, and the Webpacker loader error should be gone.

[1]:	https://tailwindcss.com/docs/using-with-preprocessors
Webpacker 6: SCSS/Sass Loaders
Tags: rails, webpacker, tutorial, sass
Published: 2020-12-24 16:11:26

In order to process `.scss` and `.sass` files with Webpacker 6, you need to add [sass-loader and sass][1].

> Note: This section builds on the [CSS section](https://andrewm.codes/blog/webpacker-6-css-loaders/)

## Install

```bash
yarn add sass-loader sass
```

## Usage

**You should be able to use the same pack tag that you added for CSS.**

Make sure you restart `bin/webpack-dev-server` after installing new loaders.

### Style Loader Example

```diff
<%# app/views/layouts/application.html.erb %>

+ <%= stylesheet_packs_with_chunks_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
```

### Extract Example

```diff
<%# app/views/layouts/application.html.erb %>

<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
+ <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
```

```diff
// app/javascript/packs/application.js

+ import "./application.scss"
```

## Verify

> Note: Make sure you restart the dev server!

Let’s create a new SCSS file:

```bash
touch app/javascript/packs/application.scss
```

Next, add some SCSS:

```css
/* app/javascript/packs/application.scss */

$body-background: #fafafa;
$body-color: #444;

body {
  background: $body-background;
  color: $body-color;
  font-family: sans-serif;
}

h1,
nav,
footer {
  text-align: center;
}

main {
  margin: 4rem auto;
  max-width: 60rem;
}
```

Reload your browser and your styles should be applied now, and the Webpacker loader error should be gone.

[1]:	https://webpack.js.org/loaders/sass-loader/
Webpacker 6: PostCSS Loaders
Tags: rails, webpacker, tutorial, postcss
Published: 2020-12-24 16:11:06

In order to process `.pcss` files with Webpacker 6, you need to add [postcss-loader][1]. I am also going to add PostCSS 8 support.

> Note: This section builds on the CSS section

## Install

```bash
yarn add postcss-loader postcss@latest autoprefixer@latest postcss-import@latest
```

### Add PostCSS Config File

```bash
touch postcss.config.js
```

```bash
// postcss.config.js

module.exports = {
  plugins: [
    require('postcss-import'),
    require('autoprefixer')
  ]
}
```

## Usage

**You should be able to use the same pack tag that you added for CSS.**

Make sure you restart `bin/webpack-dev-server` after installing new loaders.

### Style Loader Example

```diff
<%# app/views/layouts/application.html.erb %>

+ <%= stylesheet_packs_with_chunks_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
```

### Extract Example

```diff
<%# app/views/layouts/application.html.erb %>

<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
+ <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
```

```diff
// app/javascript/packs/application.js

+ import "./application.css"
```

## Verify

> Note: Make sure you restart the dev server!

Let’s create a new PostCSS file:

```bash
mkdir app/javascript/stylesheets
touch app/javascript/stylesheets/base.pcss
```

Next, add some CSS:

```css
/* app/javascript/stylesheets/base.pcss */

h1 {
  font-size: 2.2em;
  color: #2563eb;
}

p {
  font-size: 1.2em;
}
```

Lastly, update `application.css`:

```css
/* app/javascript/packs/application.css */

@import "../stylesheets/base.pcss";
```

Reload your browser and your styles should be applied now, and the Webpacker loader error should be gone.

[1]:	https://webpack.js.org/loaders/postcss-loader/ "postcss-loader"
Webpacker 6: CSS Loaders
Tags: rails, webpacker, tutorial, css
Published: 2020-12-24 16:10:53

>**This page has changed since first posted**, refer to the changelog at the bottom.

In order to process `.css` files with Webpacker 6, you need to add [css-loader][1], [style-loader][2], and [mini-css-extract-plugin][3].

## Install

```bash
yarn add css-loader style-loader mini-css-extract-plugin
```

## Usage

Add a `stylesheet_packs_with_chunks_tag` or `stylesheet_pack_tag` to the document head.

Make sure you restart `bin/webpack-dev-server` after installing new loaders.

### Style Loader Example

```diff
<%# app/views/layouts/application.html.erb %>

+ <%= stylesheet_packs_with_chunks_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
```

### Extract Example

```diff
<%# app/views/layouts/application.html.erb %>

<%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
+ <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
```

```diff
// app/javascript/packs/application.js

+ import "./application.css"
```

## Verify

> Note: Make sure you restart the dev server!

Let’s create a new file for our CSS:

```diff
touch app/javascript/packs/application.css
```

Next, add some CSS:

```css
/* app/javascript/packs/application.css */

h1 {
  font-size: 2.2em;
  color: #2563eb;
}

p {
  font-size: 1.2em;
}
```

Reload your browser and your styles should be applied now, and the Webpacker loader error should be gone.

## Changelog

- [chore: add css-minimizer-webpack-plugin](https://github.com/andrewmcodes/andrewm-codes-website/pull/12/commits/6b50b3e1a08236a09cd836c97066ddd4e3b76eed)

[1]:	(https://webpack.js.org/loaders/css-loader/
[2]:	https://webpack.js.org/loaders/style-loader/ "style-loader"
[3]:	https://github.com/webpack-contrib/mini-css-extract-plugin "mini-css-extract-plugin"
[4]:	https://webpack.js.org/plugins/css-minimizer-webpack-plugin "css-minimizer-webpack-plugin"
Webpacker 6: Upgrade Guide
Tags: rails, ruby, webpacker, tutorial
Published: 2020-12-24 16:10:35

>**This page has changed since first posted**, refer to the changelog at the bottom.

In this article, we will walkthrough how to upgrade to the latest version of [Webpacker][1], which is, at the time of writing,  `6.0.0.beta.2`.

Our upgrade process will begin with updating the Webpacker libraries, then we will update our configs and templates, and end up verifying that our new setup is working.

Let’s get started!

## Updating our `Gemfile`

Update the gem in your `Gemfile`:

```diff
# Gemfile

- gem 'webpacker', '~> 5.0'
+ gem 'webpacker', '~> 6.0.0.beta.2'
```

Next, run `bundle install` to install the new gem version. If all goes well, you should see `Using webpacker 6.0.0.beta.2 (was 5.2.1)` in the install output.

## Installing in our Application

Run the installation command, `bin/rails webpacker:install`, to generate the required configuration files, as well as update our `package.json`

## Update Document Head

Lastly, let's update `app/views/layouts/application.html.erb`. The docs for Webpacker v6 recommend using the `javascript_packs_with_chunks_tag` tag.

```diff
<%# app/views/layouts/application.html.erb %>

- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
- <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
+ <%= javascript_packs_with_chunks_tag 'application', 'data-turbolinks-track': 'reload' %>
```

## Verify Installation

Run the Rails server (`bin/rails s`) and the Webpack Dev Server (`bin/webpack-dev-server`) via your preferred method. Two terminal tabs will work or create a [Procfile][2] and run via [overmind][3] or [foreman][4]. The Rails server will also compile your assets if the dev server is not running, but this is much slower vs running separate processes and not recommended.

Visit `http://localhost:3000` in your browser. If all's well, you should see the contents of `app/views/pages/home.html.erb`.

We can verify our JavaScript is getting loaded by adding the following to `app/javascript/packs/application.js`:

```js
// app/javascript/packs/application.js

console.log('Hello from Webpacker!')
```

Open the browser console and reload the page and you should see the message we added:

```js
[Log] Hello from Webpacker! (application-7fbebc85af7886af0a64.js, line 62)
```

## Summary

Congrats! You’re up and running with Webpacker 6!

Unfortunately you will quickly realize that your upgrade is not finished if you begin developing like you usually would with Webpacker.

Webpacker 6 requires you to add the [appropriate Webpack loaders][5] yourself, which is a breaking change from previous versions.

We will tackle that [in the next article!](https://andrewm.codes/posts/webpacker-6/css-loaders/)

## Changelog

- [feat: updates for webpacker v6.0.0.beta.2](https://github.com/andrewmcodes/andrewm-codes-website/pull/11)

[1]:	https://github.com/rails/webpacker/releases "Webpacker"
[2]:	https://devcenter.heroku.com/articles/procfile
[3]:	https://github.com/DarthSim/overmind
[4]:	https://github.com/ddollar/foreman
[5]:	https://webpack.js.org/loaders/
Webpacker 6: Tutorial Setup
Tags: rails, ruby, tutorial, webpacker
Published: 2020-12-24 16:10:21

Before we start the upgrade process for Webpacker 6, we are going to create a small demo application for us to work on. 

If you are upgrading an existing app or not using this series as a tutorial, you can skip this step! We will begin the formal upgrade process in the next article.

## Generate a new Rails app

First we will generate new Ruby on Rails app:

```sh
rails new webpacker_6 --skip-sprockets --skip-spring --skip-webpack-install --skip-bundle
cd webpacker_6
```


- `--skip-sprockets`: Skip Sprockets files
- `--skip-spring`: Don't install Spring application preloader
- `--skip-bundle`: Don't run bundle install
- `--skip-webpack-install`: Don't run Webpack install

### Setup the Database

```sh
bin/rails db:prepare
```

### Turn off asset scaffolding

Prevent Rails from creating asset files when running the generators and scaffolds:

```diff
# config/application.rb

# ...
module Webpacker6
  class Application < Rails::Application
    config.load_defaults 6.1
+    config.generators do |g|
+      g.assets false
+    end
  end
end
```

## Add Pages Controller

Generate pages controller with a home action:

```sh
bin/rails g controller pages home
```

## Add Root Route

Set `pages#home` as the root route:

```diff
# config/routes.rb

Rails.application.routes.draw do
  get 'pages/home'
+  root to: 'pages#home'
  # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
```

> Note: Because we skipped the Webpacker install task, you will get an error if you try to start the application as is. We will fix that in the next article.
YouTube Video | ReactJS Tutorial for Beginners -8
Tags: react, youtube, webdev, showdev
Published: 2020-12-24 16:09:40

In this video, we will learn how to render lists.

{% youtube IKMfqdBpnuI %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.