Sha256: 6ad117853d5d2351bbfdd5364ddef9442b1c3ffcc5e5f4acb4f4f732937a4d2c
Contents?: true
Size: 701 Bytes
Versions: 2
Compression:
Stored size: 701 Bytes
Contents
<%# # Refile Index Partial This partial renders a refile link to the attachment_url to be displayed on a resource's index 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
administrate-field-refile-0.0.7 | app/views/fields/refile/_index.html.erb |
administrate-field-refile-0.0.6 | app/views/fields/refile/_index.html.erb |