Module: RedboxHelper

Defined in:
lib/redbox_helper.rb

Instance Method Summary collapse

Instance Method Details

#button_to_close_redbox(name, html_options = {}) ⇒ Object



28
29
30
31
# File 'lib/redbox_helper.rb', line 28

def button_to_close_redbox(name, html_options = {})
  @uses_redbox = true
  button_to_function name, 'RedBox.close()', html_options
end

#launch_remote_redbox(link_to_remote_options = {}, html_options = {}) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/redbox_helper.rb', line 33

def launch_remote_redbox(link_to_remote_options = {}, html_options = {})
  @uses_redbox = true
  id = id_from_url(link_to_remote_options[:url], html_options[:id])
  hidden_content_id = "hidden_content_#{id}"
  hidden_content = build_hidden_content(hidden_content_id)
  link_to_remote_options = redbox_remote_options(link_to_remote_options, hidden_content_id)
  
  return build_hidden_content(hidden_content_id) + javascript_tag(remote_function(link_to_remote_options))
end


23
24
25
26
# File 'lib/redbox_helper.rb', line 23

def link_to_close_redbox(name, html_options = {})
  @uses_redbox = true
  link_to_function name, 'RedBox.close()', html_options
end


8
9
10
11
12
# File 'lib/redbox_helper.rb', line 8

def link_to_component_redbox(name, url_options = {}, html_options = {})
  @uses_redbox = true
  id = id_from_url(url_options, html_options[:id])
  link_to_redbox(name, id, html_options) + ("span", render_component(url_options), :id => id, :style => 'display: none;')
end


3
4
5
6
# File 'lib/redbox_helper.rb', line 3

def link_to_redbox(name, id, html_options = {})
  @uses_redbox = true
  link_to_function name, "RedBox.showInline('#{id.to_s}')", html_options
end


14
15
16
17
18
19
20
21
# File 'lib/redbox_helper.rb', line 14

def link_to_remote_redbox(name, link_to_remote_options = {}, html_options = {})
  @uses_redbox = true
  id = id_from_url(link_to_remote_options[:url], html_options[:id])
  hidden_content_id = "hidden_content_#{id}"
  link_to_remote_options = redbox_remote_options(link_to_remote_options, hidden_content_id)
  
  return build_hidden_content(hidden_content_id) + link_to_remote(name, link_to_remote_options, html_options)
end