class AssetsController < ApplicationController def download(image_file_name) path = Rails.root.join("public","images",image_file_name).to_s send_file(path,...) end end
有没有更好的方法来找到路径?
ActionController::Base.helpers.asset_path('missing_file.jpg')
Access Asset Path from Rails Controller