Im new to Ruby on rails and was woking for an project of an banking app
and i was referring an rails 5 youtube video where the guy uses javascript for modal and in rails 5 the javascript file is in app>assests>javascript and continues the process but im using rails 6 where the javascript file is located outside app>javascript>packs so i did the same as he did in packs which is in rails 6 and then there was a code to add which is
= javascript_include_tag
“savings/show” since that was rails 5 and had include tag in it but in rails 6 there is pack tag so i wrote the code as
=javascript_pack tag "savings/show"
which leading to a massive webpacker error
Webpacker::Manifest::MissingEntryError in Savings#show
Showing C:/Users/swara/Documents/project/banking/app/views/savings/show.html.haml where line #26 raised:
Webpacker can't find savings/Show.js in C:/Users/swara/Documents/project/banking/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
"application.js": "/packs/js/application-0187cc22337df4280a7f.js",
"application.js.map": "/packs/js/application-0187cc22337df4280a7f.js.map",
"entrypoints": {
"application": {
"js": [
"/packs/js/application-0187cc22337df4280a7f.js"
],
"js.map": [
"/packs/js/application-0187cc22337df4280a7f.js.map"
]
}
},
"media/fonts/fontawesome-webfont.eot?v=4.7.0": "/packs/media/fonts/fontawesome-webfont-8b43027f.eot",
"media/fonts/fontawesome-webfont.svg?v=4.7.0": "/packs/media/fonts/fontawesome-webfont-c1e38fd9.svg",
"media/fonts/fontawesome-webfont.ttf?v=4.7.0": "/packs/media/fonts/fontawesome-webfont-1e59d233.ttf",
"media/fonts/fontawesome-webfont.woff2?v=4.7.0": "/packs/media/fonts/fontawesome-webfont-20fd1704.woff2",
"media/fonts/fontawesome-webfont.woff?v=4.7.0": "/packs/media/fonts/fontawesome-webfont-f691f37e.woff",
"media/fonts/glyphicons-halflings-regular.eot": "/packs/media/fonts/glyphicons-halflings-regular-5be1347c.eot",
"media/fonts/glyphicons-halflings-regular.svg": "/packs/media/fonts/glyphicons-halflings-regular-060b2710.svg",
"media/fonts/glyphicons-halflings-regular.ttf": "/packs/media/fonts/glyphicons-halflings-regular-4692b9ec.ttf",
"media/fonts/glyphicons-halflings-regular.woff": "/packs/media/fonts/glyphicons-halflings-regular-82b1212e.woff",
"media/fonts/glyphicons-halflings-regular.woff2": "/packs/media/fonts/glyphicons-halflings-regular-be810be3.woff2"
}
Extracted source (around line #26):
24
25
26
27
28
%th #{number_to_currency(@saving.balance, unit: "INR")}
= javascript_pack_tag "savings/Show"
Rails.root: C:/Users/swara/Documents/project/banking
Application Trace | Framework Trace | Full Trace
app/views/savings/show.html.haml:26
Request
Parameters:
{"id"=>"1"}
Toggle session dump
Toggle env dump
Response
Headers:
None
How will i fix this
I need to link javascript pop-up modal in rails 6