Module: Tandem::ContentsHelper

Included in:
PagesHelper
Defined in:
app/helpers/tandem/contents_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_content_tag(image_content, options = {}, format = :original) ⇒ Object



8
9
10
# File 'app/helpers/tandem/contents_helper.rb', line 8

def (image_content, options = {}, format = :original)
  image_tag image_content_url(image_content, format), options
end

#image_content_url(image_content, format = :original) ⇒ Object



4
5
6
# File 'app/helpers/tandem/contents_helper.rb', line 4

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

#text_content_text_area_options(editor = 'plain', options = {}) ⇒ Object



12
13
14
15
16
# File 'app/helpers/tandem/contents_helper.rb', line 12

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