Module: RedboxHelper
- Defined in:
- lib/redbox_helper.rb
Instance Method Summary collapse
- #button_to_close_redbox(name, html_options = {}) ⇒ Object
- #launch_remote_redbox(link_to_remote_options = {}, html_options = {}) ⇒ Object
- #link_to_close_redbox(name, html_options = {}) ⇒ Object
- #link_to_component_redbox(name, url_options = {}, html_options = {}) ⇒ Object
- #link_to_redbox(name, id, html_options = {}) ⇒ Object
- #link_to_remote_redbox(name, link_to_remote_options = {}, html_options = {}) ⇒ Object
Instance Method Details
#button_to_close_redbox(name, html_options = {}) ⇒ Object
28 29 30 31 |
# File 'lib/redbox_helper.rb', line 28 def (name, = {}) @uses_redbox = true name, 'RedBox.close()', 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( = {}, = {}) @uses_redbox = true id = id_from_url([:url], [:id]) hidden_content_id = "hidden_content_#{id}" hidden_content = build_hidden_content(hidden_content_id) = (, hidden_content_id) return build_hidden_content(hidden_content_id) + javascript_tag(remote_function()) end |
#link_to_close_redbox(name, html_options = {}) ⇒ Object
23 24 25 26 |
# File 'lib/redbox_helper.rb', line 23 def link_to_close_redbox(name, = {}) @uses_redbox = true link_to_function name, 'RedBox.close()', end |
#link_to_component_redbox(name, url_options = {}, html_options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/redbox_helper.rb', line 8 def link_to_component_redbox(name, = {}, = {}) @uses_redbox = true id = id_from_url(, [:id]) link_to_redbox(name, id, ) + content_tag("span", render_component(), :id => id, :style => 'display: none;') end |
#link_to_redbox(name, id, html_options = {}) ⇒ Object
3 4 5 6 |
# File 'lib/redbox_helper.rb', line 3 def link_to_redbox(name, id, = {}) @uses_redbox = true link_to_function name, "RedBox.showInline('#{id.to_s}')", end |
#link_to_remote_redbox(name, link_to_remote_options = {}, html_options = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/redbox_helper.rb', line 14 def link_to_remote_redbox(name, = {}, = {}) @uses_redbox = true id = id_from_url([:url], [:id]) hidden_content_id = "hidden_content_#{id}" = (, hidden_content_id) return build_hidden_content(hidden_content_id) + link_to_remote(name, , ) end |