Use different image versions on responsive sizes

This commit is contained in:
Alessandro Cuoghi
2017-06-21 16:43:08 +02:00
committed by Senén Rodero Rodríguez
parent 51d1031afa
commit aa471974bd
3 changed files with 52 additions and 18 deletions

View File

@@ -16,9 +16,8 @@ class Budget
acts_as_votable
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases
# TODO: ROCK&ROR: Set image versions sizes acordingly to enhance page load
has_attached_file :image, styles: { large: "600x600>", medium: "300x300>", thumb: "100x100>" }
has_attached_file :image, styles: { large: "600x600>", medium: "300x300#", thumb: "140x245#" }
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
belongs_to :heading