
Modern Asset Pipeline & Frontend
Importmap-rails (Rails 7+), jsbundling/cssbundling, Hotwire (Turbo + Stimulus), Sprockets (legacy)
1What is the default asset management system in Rails 7+?
What is the default asset management system in Rails 7+?
Jawaban
Importmap-rails is the default system in Rails 7+ for managing JavaScript files. It allows using native ES modules directly in the browser without a bundling step, by mapping package names to CDN URLs or local files. This significantly simplifies frontend configuration while eliminating the Node.js dependency.
2How to add an external JavaScript library with Importmap-rails?
How to add an external JavaScript library with Importmap-rails?
Jawaban
The bin/importmap pin command adds a JavaScript library to the config/importmap.rb file. This command automatically resolves the package from jspm.io or a CDN and adds the corresponding mapping. For example, bin/importmap pin lodash adds the pin line for lodash pointing to the CDN.
3Which Rails helper to use for including JavaScript scripts defined in the importmap?
Which Rails helper to use for including JavaScript scripts defined in the importmap?
Jawaban
The javascript_importmap_tags helper generates the necessary tags to load the importmap and JavaScript entry point. It produces a script tag type='importmap' containing the mappings, as well as a tag to load the application.js file. This helper replaces javascript_pack_tag used with Webpacker.
What is the main difference between jsbundling-rails and cssbundling-rails?
What is the main role of Turbo Drive in Hotwire?
+15 pertanyaan wawancara
Topik wawancara Ruby on Rails lainnya
Ruby Basics
Ruby Object-Oriented Programming
Rails Fundamentals
Routing & Controllers
ActiveRecord Basics
Views & ERB Templates
ActiveRecord Associations
Advanced ActiveRecord Queries
Rails Forms
Authentication & Authorization
Rails API Mode
Testing with RSpec
ActiveJob & Background Jobs
ActionCable & WebSockets
ActionMailer
ActiveStorage
Caching Strategies
Advanced Migrations
Rails Engines & Modular Apps
Performance Optimization
Rails Design Patterns
Ruby Metaprogramming
Rails Security
GraphQL with Rails
Deployment & Production
Monitoring & Logging
Rails Upgrade Strategies
Kuasai Ruby on Rails untuk wawancara berikutnya
Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.
Mulai gratis