mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Add expiring URL to experiment img
This commit is contained in:
parent
f77e0d4a6e
commit
7b0f323576
2 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ class Experiment < ActiveRecord::Base
|
||||||
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
|
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
|
||||||
has_many :report_elements, 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_attachment_content_type :workflowimg, content_type: /\Aimage\/.*\Z/
|
||||||
|
|
||||||
validates :name,
|
validates :name,
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<% if experiment.workflowimg? %>
|
<% if experiment.workflowimg? %>
|
||||||
<div class="workflowimg-container">
|
<div class="workflowimg-container">
|
||||||
<%= link_to image_tag(experiment.workflowimg,
|
<%= link_to image_tag(experiment.workflowimg.expiring_url(30),
|
||||||
class: 'img-responsive center-block'),
|
class: 'img-responsive center-block'),
|
||||||
canvas_experiment_path(experiment) %>
|
canvas_experiment_path(experiment) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue