Lotties with Rails 6 and Webpacker

1) Install Lottie Player:

```bash
npm install --save @lottiefiles/lottie-player
```

2) Require it at **app/javascript/packs/application.js**

```js
require('@lottiefiles/lottie-player');
```

3) Set webpacker to load jsons at **config/webpacker.yml**

```yml
static_asset_extensions:
  - .json
```

4) Put your lotties jsons wherever you want e.g. **app/javascript/images/lotties**

5) Render **lottie-player** tag in your htm

```haml
%lottie-player{ autoplay: true,
                loop: true,
                src: asset_pack_path('media/images/lotties/mylottie.json') }
```

6) Profit

carlos-muniz
February 15, 2021
