<% fieldname_p = fieldname.pluralize %> <%= f.label "fieldname", t('admin.'+fieldname) %> <%= fields_for "design["+(fieldname_p)+"][]", object, :index => nil do |f| %> <%= f.file_field :file ,{:class=>"multi_files",:rtype=>rtype}%> <% end %>