Module: ContentBlockHelper

Defined in:
app/helpers/content_block_helper.rb

Instance Method Summary collapse

Instance Method Details

#f7_content_block(*args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/content_block_helper.rb', line 3

def f7_content_block(*args, &block)
  output = []
  title = nil
  options = {}
  if args.count > 0
    if (args.first.kind_of?(String) || args.first.kind_of?(Symbol))
      title = args.first
      options = args.second || {}
    elsif arg.first.kind_of? Hash
      options = args.first
      title = options[:title]
      options = options.reject { |k,v| k == :title }
    end
  end
  output << content_block_title_div(title) unless title.nil?
  output << content_block_div(options) do
    yield if block_given?
  end
  output.join("\n").html_safe
end