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)

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

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

#displayable_content_block(content_block, **options) ⇒ Object


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

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