Sha256: c41f7d64178af6108384877bc73f354607ac9a1337b4dfe160244c62ace96a39

Contents?: true

Size: 714 Bytes

Versions: 9

Compression:

Stored size: 714 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.id,
                             :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

9 entries across 9 versions & 1 rubygems

Version Path
typus-3.0.2 app/views/admin/templates/_file.html.erb
typus-3.0.1 app/views/admin/templates/_file.html.erb
typus-3.0.0 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre13 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre12 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre11 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre10 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre9 app/views/admin/templates/_file.html.erb
typus-1.0.0.pre8 app/views/admin/templates/_file.html.erb