Module: Hyrax::ContentBlockHelperBehavior

Included in:
ContentBlockHelper
Defined in:
app/helpers/hyrax/content_block_helper_behavior.rb

Instance Method Summary collapse

Instance Method Details

#display_content_block?(content_block) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/helpers/hyrax/content_block_helper_behavior.rb', line 9

def display_content_block?(content_block)
  content_block.present? && content_block.value.present?
end

#displayable_content_block(content_block, **options) ⇒ Object



4
5
6
7
# File 'app/helpers/hyrax/content_block_helper_behavior.rb', line 4

def displayable_content_block(content_block, **options)
  return unless display_content_block? content_block
  tag.div(raw(content_block.value), **options)
end