Complete the code to serve static files from the public folder in Rails.
Rails.application.config.serve_static_files = [1]Setting serve_static_files to true tells Rails to serve files from the public folder.
Complete the code to add a CSS file named style.css to the asset pipeline in Rails.
Rails.application.config.assets.precompile += %w([1])Adding style.css to assets.precompile ensures it is included in the asset pipeline.
Fix the error in the code to correctly reference an image asset in a Rails view.
<%= image_tag '[1]' %>
Use just the filename like logo.png with image_tag. Rails handles the asset path automatically.
Fill both blanks to create a hash that maps asset names to their digest paths in Rails.
assets = { '[1]' => '[2]' } # maps logical name to digest pathThe logical asset name is application.css and the digest path includes a hash like application-123abc.css.
Fill all three blanks to write a Rails helper method that returns the full path for a given asset name.
def asset_full_path(name) File.join(Rails.root, 'public', [1], [2] + name + [3]) end
This method joins the Rails root, public folder, assets folder, then adds a slash, the asset name, and a dot for extension.