Method: Booties::Panel#initialize

Defined in:
lib/booties/panel.rb

#initialize(view_context, context: :default, wrapper_tag: 'div', **options) ⇒ Panel

Instantiates a new Panel. Several helper methods like #content_tag will be delegated to view_context.

The optional context argument can be passed in to specify the panel context; otherwise, the context :default is used.

The default behavior is to use a div tag for to top-level panel container, but you may specify a different tag using the wrapper_tag keyword. (There are no guarantees on whether or not other tags will work correctly with Bootstrap panels.

Any additional options will be included as attributes on the top-level panel container.



29
30
31
32
33
34
35
# File 'lib/booties/panel.rb', line 29

def initialize(view_context, context: :default, wrapper_tag: 'div', **options)
  @view_context = view_context
  @wrapper_tag  = wrapper_tag
  @context      = context
  # TODO: pass options to #render instead of constructor
  @options      = options
end