我尝试将onMeasure
与一个附件一起使用。我能够上传附件。
我的问题是生成网址。我正在使用ActiveStorage
url_for
我收到此错误
class Template < ApplicationRecord
acts_as_archival readonly_when_archived: true
before_archive
belongs_to :user
has_many :fields, dependent: :destroy
accepts_nested_attributes_for :fields, allow_destroy: true
has_many :contracts
has_one_attached :image
end
<%= url_for(@template.image) %>
答案 0 :(得分:0)
答案 1 :(得分:0)
我很确定你在旧宝石上合并到Rails之前。如果你这样做
bundle show activestorage
我认为它会说你正在使用gems / activestorage-0.1
尝试捆绑边缘导轨:
gem 'rails', git: 'https://github.com/rails/rails.git'
如果这并没有炸毁您的整个应用程序,您将能够访问您最近希望使用的最近编写的方法。