Sha256: 927d8dd98effc12a75b6ed5880572bd89aba0453b145caf939ab30fde378d862

Contents?: true

Size: 711 Bytes

Versions: 2

Compression:

Stored size: 711 Bytes

Contents

<%

  # attachment = attribute.split('_file_name').first

  if !@item.class.validators.map { |i| i.class }.include?(ActiveModel::Validations::PresenceValidator) && @item.send(attribute).exists?
    message = _t("Remove %{attribute}", :attribute => @item.class.human_attribute_name(attribute).downcase)
    label_text << <<-HTML
 <small>#{link_to message, { :action => 'detach',
                             :id => @item,
                             :attachment => attribute },
                             :confirm => _t("Are you sure?")}</small>
    HTML
  end

%>

<li>
  <%= form.label attribute, raw(label_text) %>
  <%= form.file_field attribute, options %>
  <%= typus_preview(@item, attribute) %>
</li>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typus-1.0.0.pre7 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre6 app/views/admin/templates/_file.html.erb