Add expiring URL to experiment img

This commit is contained in:
Jure Grabnar 2016-08-09 16:37:44 +02:00
parent f77e0d4a6e
commit 7b0f323576
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ class Experiment < ActiveRecord::Base
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
has_many :report_elements, inverse_of: :experiment, dependent: :destroy
has_attached_file :workflowimg, styles: { medium: '300x300>' }
has_attached_file :workflowimg
validates_attachment_content_type :workflowimg, content_type: /\Aimage\/.*\Z/
validates :name,

View file

@ -36,7 +36,7 @@
<div class="panel-body">
<% if experiment.workflowimg? %>
<div class="workflowimg-container">
<%= link_to image_tag(experiment.workflowimg,
<%= link_to image_tag(experiment.workflowimg.expiring_url(30),
class: 'img-responsive center-block'),
canvas_experiment_path(experiment) %>
</div>