Prerequisite:
Check out the changes https://github.com/pearlbea/bloaty-mcbloatface/pull/1
$ yarn run prod
/stories/:id
and /users/:id
pagesCreate a "story" pack, similar to the application pack
app/javascript/packs/story.ts
to import app/javascript/story.ts
and init
itstory
import and init
from app/javascript/app.ts
Add the "story" pack to the view
Enable content_for(:js)
in app/views/layouts/application.html.erb
Add content_for(:js)
block with a javascript_pack_tag
to app/views/stories/show.html.erb
For guidance see the content_for
docs
Split "users" pack from app
users
import in app/javascript/packs/application.ts
users
javascript_pack_tag
in app/views/layouts/users.html.erb
yarn run prod
if you have not already