Skip to content

Instantly share code, notes, and snippets.

CarrierWave.configure do |config|
if Rails.env.production?
CarrierWave::Uploader::Base.storage_engines = :file
elsif Rails.env.heroku_staging?
config.fog_provider = 'fog-aws'
config.fog_credentials = {
def media_video_link_content( guide )
blank_link = guide.send("video_#{I18n.locale}").blank?
tag = blank_link ? 'div' : 'a'
html_option = { :class => 'video_link pull-left' }
html_option.merge!( :href => guide.video_link ) if tag == 'a'
content_tag( tag, html_option ) do
#TODO refactory with including portrait_files
if guide.portrait.includes(:portrait_files).present?
content_tag( :div, :class => 'guide_image', :style => 'position:relative' ) do
concat( cl_image_tag(asset_path("play-2.png"), style: "position:absolute;height:128px;opacity:0", class: 'overlay') ) unless blank_link