【发布时间】:2011-09-25 00:53:47
【问题描述】:
要在 Controller 中获取图像路径,我使用以下方法:
class AssetsController < ApplicationController
def download(image_file_name)
path = Rails.root.join("public", "images", image_file_name).to_s
send_file(path, ...)
end
end
有没有更好的查找路径的方法?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3