-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 7 with importmap #289
Comments
I spent whole afternoon learned how to import jquery in Rails 7 edit in Gemfile and run gem 'jquery-rails' edit application.js // app/javascript/application.js
// jquery
import 'jquery'
import 'jquery_ujs' edit importmap.rb # config/importmap.rb
pin "jquery", to: "jquery.min.js", preload: true
pin "jquery_ujs", to: "jquery_ujs.js", preload: true edit config/initializers/assets.rb
finally should work |
and if you want a specific version of jQuery (2 or 3):
|
The solution is working. If you use Sprockets 4.x then it's recommended to use
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How I can make it work?
The text was updated successfully, but these errors were encountered: