From 7b0f323576a4400e4d3a37c076fa580c47079158 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Tue, 9 Aug 2016 16:37:44 +0200 Subject: [PATCH] Add expiring URL to experiment img --- app/models/experiment.rb | 2 +- app/views/projects/show/_experiment.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index 9f9b0d629..86671e8c8 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -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, diff --git a/app/views/projects/show/_experiment.html.erb b/app/views/projects/show/_experiment.html.erb index f32d2c69b..36b576b0f 100644 --- a/app/views/projects/show/_experiment.html.erb +++ b/app/views/projects/show/_experiment.html.erb @@ -36,7 +36,7 @@
<% if experiment.workflowimg? %>
- <%= link_to image_tag(experiment.workflowimg, + <%= link_to image_tag(experiment.workflowimg.expiring_url(30), class: 'img-responsive center-block'), canvas_experiment_path(experiment) %>