Module: Merb::Slices::ControllerMixin::MixinMethods

Defined in:
lib/merb-slices/controller_mixin.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



103
104
105
106
# File 'lib/merb-slices/controller_mixin.rb', line 103

def self.extended(klass)
  klass.send(:include, InstanceMethods)
  klass.hide_action :slice if klass.respond_to?(:hide_action)
end

Instance Method Details

#layout_for_slice(layout = nil) ⇒ Object

Use the slice’s layout - defaults to underscored identifier.

This is set for generated stubs that support layouts.

Parameters:

  • layout (#to_s) (defaults to: nil)

    The layout name to use.



113
114
115
# File 'lib/merb-slices/controller_mixin.rb', line 113

def layout_for_slice(layout = nil)
  layout(layout || self.slice.config[:layout]) if layout || self.slice.config.key?(:layout)
end