Sha256: be4ffedb2722b6ec057b0800eb1d2129739f93642262b86dff2bd7b6252e18de

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 Bytes

Contents

<%#
# Refile Show Partial

This partial renders refile attachment(s),
to be displayed on a resource's show page.

By default, the attribute is rendered as a link tag.

## Local variables:

- `field`:
  An instance of [Administrate::Field::Refile][1].
%>

<% return nil if field.data.nil? %>
<% if @_requested_resource.public_send("#{field.name}").is_a?(Array) %>
  <% @_requested_resource.public_send("#{field.name.split('_')[0]}").each do |photo| %>
    <%= link_to photo.file_filename, attachment_url(photo, :file) %>
  <% end %>
<% else %>
  <%= link_to @_requested_resource.public_send("#{field.name}_filename"), attachment_url(@_requested_resource, field.attribute) %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
administrate-field-refile-0.0.7 app/views/fields/refile/_show.html.erb
administrate-field-refile-0.0.6 app/views/fields/refile/_show.html.erb
administrate-field-refile-0.0.4 app/views/fields/refile/_show.html.erb
administrate-field-refile-0.0.3 app/views/fields/refile/_show.html.erb