Module: DynamicQueryHelper

Defined in:
app/helpers/dynamic_query_helper.rb

Instance Method Summary collapse

Instance Method Details

#combined_result(result) ⇒ Object



16
17
18
19
20
# File 'app/helpers/dynamic_query_helper.rb', line 16

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

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

Yields:

  • (html)


2
3
4
5
6
7
8
# File 'app/helpers/dynamic_query_helper.rb', line 2

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

#dynamic_result(result) ⇒ Object



10
11
12
13
14
# File 'app/helpers/dynamic_query_helper.rb', line 10

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