Module: DynamicQuery::Helper

Defined in:
lib/dynamic_query/helper.rb

Instance Method Summary collapse

Instance Method Details

#combined_result(result) ⇒ Object



17
18
19
20
21
# File 'lib/dynamic_query/helper.rb', line 17

def combined_result(result)
  template = ERB.new(File.read(File.dirname(__FILE__) + '/../../app/helpers/_combined_result.html.erb'))
  content = template.result(binding)
  content.html_safe
end

#dynamic_query(panel, opt = {}) {|html| ... } ⇒ Object

Yields:

  • (html)


3
4
5
6
7
8
9
# File 'lib/dynamic_query/helper.rb', line 3

def dynamic_query(panel, opt = {})
  html = ''
  yield html if block_given?
  template = ERB.new(File.read(File.dirname(__FILE__) + '/../../app/helpers/_dynamic_query.html.erb'))
  content = template.result(binding)
  content.html_safe
end

#dynamic_result(result) ⇒ Object



11
12
13
14
15
# File 'lib/dynamic_query/helper.rb', line 11

def dynamic_result(result)
  template = ERB.new(File.read(File.dirname(__FILE__) + '/../../app/helpers/_dynamic_result.html.erb'))
  content = template.result(binding)
  content.html_safe
end