Contents:
Provides some basic generator support that is generally required in various Generators
From merb/session/cookie_store.rb
Most of this code is taken from bitsweat’s implementation in rails
From merb/mixins/web_controller.rb
Used by secondary actions (a PartsController or the view) to provide the standard objects associated with each request.
From merb/mixins/general_controller.rb
This module provides helper style functionality to all controllers.
| Modules | |
|---|---|
| Assets | |
| AuthenticationMixin | |
| BootLoader | |
| Caching | |
| Const | |
| ControllerExceptions | ControllerExceptions are a way of simplifying controller code by placing exceptional logic back into the MVC pattern. |
| ControllerMixin | Module that is mixed in to all implemented controllers. |
| ErubisCaptureMixin | |
| GeneralControllerMixin | |
| GeneratorHelpers | |
| GlobalHelper | |
| InlinePartialMixin | |
| Plugins | |
| Rack | |
| RenderMixin | |
| ResponderMixin | The ResponderMixin adds methods that help you manage what formats your controllers have available, determine what format(s) the client requested and is capable of handling, and perform content negotiation to pick the proper content format to deliver. |
| SessionMixin | |
| Template | |
| Test | |
| ViewContextMixin | The ViewContextMixin module provides a number of helper methods to views for linking to assets and other pages, dealing with JavaScript, and caching. |
| WebControllerMixin | |
| Classes | |
|---|---|
| AbstractController | |
| AppGenerator | |
| Config | |
| Controller | All of your web controllers will inherit from Merb::Controller. This superclass takes care of parsing the incoming headers and body into params and cookies and headers. If the request is a file upload it will stream it into a tempfile and pass in the filename and tempfile object to your controller via params. It also parses the ?query=string and puts that into params as well. |
| CookieStore | If you have more than 4K of session data or don’t want your data to be visible to the user, pick another session store. |
| Cookies | Cookies are read and written through Merb::Controller#cookies. The cookies you read are those received in request along with those that have been set during the current request. The cookies you write will be sent out with the response. Cookies are read by value (so you won’t get the cookie object itself back — just the value it holds). |
| Dispatcher | |
| DrbServiceProvider | |
| Logger | |
| MailController | Sending mail from a controller involves three steps: |
| Mailer | You’ll need a simple config like this in merb_init.rb if you want to actually send mail: |
| MemCacheSession | Sessions stored in memcached. |
| MemorySession | Sessions stored in memory. |
| MemorySessionContainer | |
| PartController | |
| PluginGenerator | |
| Request | |
| Router | |
| Server | |
| UploadProgress | Keeps track of the status of all currently processing uploads |
| ViewContext | The ViewContext is really just an empty container for us to fill with instance variables from the controller, include helpers into and then use as the context object passed to Erubis when evaluating the templates. |
| Constants | |
|---|---|
| GENERATOR_ |
Set up default generator scope |
| PROTECTED_ |
|
| RELEASE | Merb::RELEASE meanings: ‘svn’ : unreleased ‘pre’ : pre-release Gem candidates |
| VERSION | |
| Public Attributes | |
|---|---|
| logger | Logger settings |
| Public Methods | |
|---|---|
| add_ |
Any specific outgoing headers should be included here. These are not the content-type header but anything in addition to it. tranform_method should be set to a symbol of the method used to transform a resource into this mime type. For example for the :xml mime type an object might be transformed by calling :to_xml, or for the :js mime type, :to_json. If there is no transform method, use nil. |
| add_ |
Adds outgoing headers to a mime type. This can be done with the Merb.add_mime_type method or directly here. |
| application_ |
|
| available_ |
Provides the currently implemented mime types as a hash |
| controller_ |
|
| environment | |
| environment= | |
| exception | PLEASE STOP REMOVING THIS ONE GUYS! It’s used to show exceptions in the log file this is the second time I’ve had to add it back. |
| framework_ |
|
| framework_ |
Framework paths |
| helper_ |
|
| lib_ |
|
| load_ |
|
| log_ |
|
| mailer_ |
|
| mime_ |
Return the method name (if any) for the mimetype |
| mime_ |
Return default arguments for transform method (if any) |
| model_ |
|
| part_ |
|
| remove_ |
|
| remove_ |
Completely removes any headers set that are additional to the content-type header. |
| reset_ |
Sets the mime types and outgoing headers to their original states |
| response_ |
|
| root | Application paths |
| root= | |
| root_ |
|
| router_ |
|
| set_ |
Set default arguments/proc for a format transform method |
| skeleton_ |
|
| svn_ |
|
| svn_ |
|
| svn_ |
|
| svn_ |
|
| view_ |
|
<code/>and<pre/>for code samples.