June 2021
Intermediate to advanced
398 pages
9h 35m
English
With Webpacker installed, let’s take it for a spin and build something.
First, let’s make sure everything is working. To connect the Webpacker build to our app, we need to add two helper method calls to the app/views/layouts/application.html.erb file, like so:
| | <!DOCTYPE html> |
| | <html> |
| | <head> |
| | <title>North By North East</title> |
| | <meta name="viewport" content="width=device-width,initial-scale=1"> |
| | <%= csrf_meta_tags %> |
| | <%= csp_meta_tag %> |
| | <%= stylesheet_pack_tag( |
| | "application", |
| | media: "all", |
| | "data-turbolinks-track": "reload" |
| | ) %> |
| | <%= javascript_pack_tag("application", "data-turbolinks-track": "reload") %> |
| | </head> |
| | <body> ... |