Class Merb::PartController
In: lib/merb-parts/part_controller.rb
Parent: AbstractController

A Merb::PartController is a light weight way to share logic and templates amongst controllers. Merb::PartControllers work just like Merb::controller. There is a filter stack, layouts (if needed) all the render functions, and url generation.

Cookies, params, and even the request object are shared with the web controller

Methods

Included Modules

Merb::Mixins::WebController

Attributes

params  [R] 

Public Class methods

Sets the template root to the default parts view directory.

Parameters

klass<Class>:The Merb::PartController inheriting from the base class.

Parameters

web_controller<Merb::Controller>:The controller calling this part.
opts<Hash>:Additional options for this part.

Returns

Array[Class]:Classes that inherit from Merb::PartController.

Public Instance methods

Parameters

action<~to_s>:An action to dispatch to. Defaults to :to_s.

Returns

String:The part body.

Parameters

action<~to_s>:The name of the action that will be rendered.
type<~to_s>:The mime-type of the template that will be rendered. Defaults to nil.
controller<~to_s>:The name of the controller that will be rendered. Defaults to controller_name.

Returns

String:The template location, i.e. ":controller/:action.:type".

Send any methods that are missing back up to the web controller Patched to set partial locals on the web controller

[Validate]