Class: Trestle::ContainerHelper::Context
- Inherits:
-
Object
- Object
- Trestle::ContainerHelper::Context
- Defined in:
- app/helpers/trestle/container_helper.rb
Instance Method Summary collapse
- #default_sidebar_options ⇒ Object
-
#initialize(template) ⇒ Context
constructor
A new instance of Context.
- #sidebar(options = {}, &block) ⇒ Object
Constructor Details
#initialize(template) ⇒ Context
Returns a new instance of Context.
14 15 16 |
# File 'app/helpers/trestle/container_helper.rb', line 14 def initialize(template) @template = template end |
Instance Method Details
#default_sidebar_options ⇒ Object
27 28 29 |
# File 'app/helpers/trestle/container_helper.rb', line 27 def Trestle::Options.new(class: ["main-content-sidebar"]) end |
#sidebar(options = {}, &block) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/helpers/trestle/container_helper.rb', line 18 def (={}, &block) if block_given? @sidebar = @template.content_tag(:aside, .merge(), &block) nil else @sidebar end end |