Sha256: 57c90d44d31784396b4e00f99114cc810b4c30a9fa54dc43c4f26418f1fc8597

Contents?: true

Size: 907 Bytes

Versions: 1

Compression:

Stored size: 907 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id$

require 'nitro/render'
require 'nitro/scaffold'
require 'nitro/filters'

module N
	
# The Controller part in the MVC paradigm.
# A Controller encpsulates a set of actions.

class Controller 
	include Render
	include Scaffolding
	include Filtering		

	# Use the method_missing hook to compile the actions
	# for this controller.
	
	def method_missing(action, *args)
		if Rendering.compile_action(self.class, action, @base)
			send(action, *args)
		else
			super
		end
	end

	class << self 
		alias __old_inherited inherited

		def inherited(subclass)
			subclass.class_eval %{
				DEF_FILE = caller[2].split(':').first
			}	
			__old_inherited(subclass)
		end
	end

end

# A simple controller, only handles templates.
# Useful to implement php/asp/jsp style applications.

class SimpleController < Controller
end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.10.0 lib/nitro/controller.rb