需求这样的,
<%= f.hidden_field :name %> <%= f.input :file, :label => "" %>
希望file字段的label和name字段保持一致
file字段
label
name字段
f.object.name
#1 楼 @ashchan 给力! 我都去写 JS 了...attr_accessor :object_name, :object, :options 粗略地看了源码,真心没看出来
attr_accessor :object_name, :object, :options