Sha256: baa97e98644a1f7bc2817949fcac0ec1b1b57928f46fb0b238bad8019ed3867d

Contents?: true

Size: 618 Bytes

Versions: 2

Compression:

Stored size: 618 Bytes

Contents

module Tandem
  module ContentsHelper

    def image_content_url(image_content, format = :original)
      image_content.image.present? ? image_content.image.resource.url(format) : 'tandem/blank_image.jpg'
    end

    def image_content_tag(image_content, options = {}, format = :original)
      options = {style: ""}.merge(options) if format == :thumb
      image_tag image_content_url(image_content, format), options
    end

    def text_content_text_area_options(editor = 'plain', options = {})
      options.tap do |options|
        options[:class] = 'wymeditor' if editor == 'wysiwyg'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tandem-0.2.0 app/helpers/tandem/contents_helper.rb
tandem-0.2.0.rc app/helpers/tandem/contents_helper.rb