【发布时间】:2014-04-16 07:42:52
【问题描述】:
我正在尝试在从我的 rails 应用程序(资产/图像)中包含的图像迁移时直接在我的数据库上生成默认图像。
在这种迁移之前,我直接在终端上点击我的命令。
我想要这样的东西:
File.new('path/to/my/default/avatar')
我试过ActionController::Base.helpers.asset_path、asset_path、Rails.root.join。
如果这种方式根本不适合做我想做的事,请告诉我最好的方式。 :-)
【问题讨论】:
标签: ruby file ruby-on-rails-4 rails-migrations file-location