Sha256: 915ccec82b968e927a56bdd39c8e13be5f93d612a6f2195c9f089851c47d5cca

Contents?: true

Size: 709 Bytes

Versions: 5

Compression:

Stored size: 709 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 = _("Remove %{attribute}", :attribute => @item.class.human_attribute_name(attribute).downcase)
    label_text << <<-HTML
 <small>#{link_to message, { :action => 'detach',
                             :id => @item,
                             :attachment => attribute },
                             :confirm => _("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

5 entries across 5 versions & 1 rubygems

Version Path
typus-1.0.0.pre5 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre4 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre3 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre2 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre app/views/admin/templates/_file.html.erb