   # @param	function
   # @return	void
   #
-  render: ($view, $data = {}, $next) =>
+  render: ($view, $data = {}, $next) ->
 
     #
-    # View Controller constructor
+    # Inner Controller class
     #
-    #   Wrap view data with controller methods
-    #   This gives the view access to all methods and
-    #   properties of the controller
-    #
-    # @access	private
-    # @param	object
-    #
-    Controller = ($data) ->
-      for $key, $obj of $data
-        @[$key] = $obj
-      return
+    class Controller
+
+      #
+      # Wrap view data with controller methods
+      # This gives the view access to all methods and
+      # properties of the controller
+      #
+      # @access	private
+      # @param	object
+      #
+      constructor: ($data) ->
+        for $key, $obj of $data
+          @[$key] = $obj
 
     # Here's the magic -
     # expose the current controller via the prototype


class global.Exspresso_Controller

  __hasOwnProperty    = Object.hasOwnProperty
  __defineProperty    = Object.defineProperty
  __defineProperties  = Object.defineProperties

  #

  # @param	string
  # @return	void
  #
  redirect: ($url) ->
    Exspresso.hooks._call_hook 'post_controller', @
    @res.redirect $url



