Module: YouthTree::Helpers::SidebarHelper
- Defined in:
- lib/youth_tree/helpers/sidebar_helper.rb
Instance Method Summary collapse
-
#default_sidebar ⇒ Object
Renders a default sidebar.
-
#has_sidebar? ⇒ Boolean
Do we have a sidebar?.
-
#main_content_class ⇒ Object
Content class, inc.
-
#render_to_sidebar!(partial_name, options = {}) ⇒ Object
Render content for sidebar.
-
#sidebar_contains(*args, &blk) ⇒ Object
Set sidebar content.
-
#sidebar_content ⇒ Object
Returns the sidebar content.
Instance Method Details
#default_sidebar ⇒ Object
Renders a default sidebar
32 33 34 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 32 def render(:partial => 'shared/default_sidebar') end |
#has_sidebar? ⇒ Boolean
Do we have a sidebar?
12 13 14 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 12 def .present? && end |
#main_content_class ⇒ Object
Content class, inc. sidebar
22 23 24 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 22 def main_content_class (Array(@extra_content_classes) + [ ? "left" : "full-width"]).uniq.sort.join(" ") end |
#render_to_sidebar!(partial_name, options = {}) ⇒ Object
Render content for sidebar
27 28 29 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 27 def (partial_name, = {}) render(.merge(:partial => partial_name)) end |
#sidebar_contains(*args, &blk) ⇒ Object
Set sidebar content
17 18 19 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 17 def (*args, &blk) content_for :sidebar, *args, &blk end |
#sidebar_content ⇒ Object
Returns the sidebar content.
6 7 8 9 |
# File 'lib/youth_tree/helpers/sidebar_helper.rb', line 6 def content = content_for :sidebar content.present? ? content : end |