Methods

Picombo::Controllers

Controller Module

Controllers are the front level classes that expose your app to the web. They pass information to the model, retrieve information from the model, and pass data to views, which contain the final output for users.

Calling Controllers

Controllers are called via URIs, i.e. example.com/foobar/baz

Controller Naming Conventions

Controller Arguments

Controller arguments are passed via URI segments after the second, i.e. example.com/foobar/baz/foo/bar

The arguments must match the method exactly or a 404 exception will occur

Example Controller

 module Picombo
     module Controllers
         class Foobar
             def index
                 Picombo::Core.response('Hello World!')
             end
         end
     end
 end

This controller and method could be called via example.com/foobar/index

Public Class Methods

const_missing(name) click to toggle source

Autoloader for missing controller names

     # File lib/core/core.rb, line 290
290:         def Controllers.const_missing(name)
291:             filename = name.to_s
292: 
293:             require 'controllers/'+filename.downcase.gsub(/_/, '/')
294: 
295:             raise LoadError if ! const_defined?(name)
296: 
297:             klass = const_get(name)
298:             return klass if klass
299:             raise LoadError
300:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.