Module Merb::Slices::ControllerMixin::ClassMethods
In: lib/merb-slices/controller_mixin.rb

Methods

Public Instance methods

Setup a controller to reference a slice and its template roots

This method is available to any class inheriting from Merb::AbstractController; it enabled correct location of templates, as well as access to the slice module.

@param slice_module<to_s> The slice module to use; defaults to current module. @param options<Hash>

  Optional parameters to set which component path is used (defaults to :view) and
  the :path option lets you specify a subdirectory of that component path.
  When :layout is set, then this is used instead of the config's :layout setting.

@example controller_for_slice # uses current module @example controller_for_slice SliceMod # defaults to :view templates and no subdirectory @example controller_for_slice :templates_for => :mailer, :path => ‘views’ # for Merb::Mailer @example controller_for_slice SliceMod, :templates_for => :mailer, :path => ‘views’ # for Merb::Mailer

[Validate]