Module: NetherHelper
- Defined in:
- app/helpers/nether_helper.rb
Instance Method Summary collapse
-
#nether(total_pages, url = nil, identifier = nil, container = nil) ⇒ Object
Replaces manual pagination links with endless page.
-
#nether_sticky_content(content_options = {}, &block) ⇒ Object
Creates a content area that can be paired with nether_sticky_footer.
-
#nether_sticky_footer(footer_options = {}, &block) ⇒ Object
Creates a sticky footer that is paired with nether_sticky_body.
-
#nether_sticky_wrap(wrap_options = {}, content_options = {}, &block) ⇒ Object
Creates a wrapper that sticks nether sticky content in place.
Instance Method Details
#nether(total_pages, url = nil, identifier = nil, container = nil) ⇒ Object
Replaces manual pagination links with endless page.
Signatures
nether(total_pages, url, identifier)
nether(total_pages, url, identifier, container)
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/nether_helper.rb', line 10 def nether(total_pages, url=nil, identifier=nil, container=nil) opts = { :totalPages => total_pages, :url => escape_javascript(url), :loaderMsg => 'Loading more results' } container && opts[:container] ||= container javascript_tag("$('#{identifier}').pageless(#{opts.to_json});") end |
#nether_sticky_content(content_options = {}, &block) ⇒ Object
Creates a content area that can be paired with nether_sticky_footer
Signatures
nether_sticky_content() do
# ...
end
nether_sticky_content( = {}) do
# ...
end
56 57 58 59 60 61 62 63 64 65 66 |
# File 'app/helpers/nether_helper.rb', line 56 def nether_sticky_content(={}, &block) if block_given? [:class] ||= "nether_content" = () "<div#{}>#{capture(&block)}</div>".html_safe else raise ArgumentError, "Missing block" end end |
#nether_sticky_footer(footer_options = {}, &block) ⇒ Object
Creates a sticky footer that is paired with nether_sticky_body
Signatures
() do
# ...
end
( = {}) do
# ...
end
79 80 81 82 83 84 85 86 87 88 89 |
# File 'app/helpers/nether_helper.rb', line 79 def (={}, &block) if block_given? [:class] ||= "nether_footer" = () "<div#{}>#{capture(&block)}</div>".html_safe else raise ArgumentError, "Missing block" end end |
#nether_sticky_wrap(wrap_options = {}, content_options = {}, &block) ⇒ Object
Creates a wrapper that sticks nether sticky content in place.
Signatures
nether_sticky_wrap() do
# ...
end
nether_sticky_wrap( = {}) do
# ...
end
33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/helpers/nether_helper.rb', line 33 def nether_sticky_wrap(={}, ={}, &block) if block_given? [:class] ||= "nether_wrap" = () "<div#{}>#{capture(&block)}</div>".html_safe else raise ArgumentError, "Missing block" end end |