With Hobo 0.8.4, 0.8.5 and edge, subsite controllers appear to be
incomplete?  When I try to call current_user or render, I get
"undefined local variable or method `current_user' for
Admin::AdminSiteController:Class".


Here's how to reproduce...  Starting with a blank Hobo app:

ruby script/generate hobo_migration --migrate --default-name
script/generate hobo_subsite --make-front-site admin


Then I add a before_filter to force the user to be an admin:

diff --git a/app/controllers/admin/admin_site_controller.rb b/app/controllers/ad
index 9a8cb11..ae5c6fb 100644
--- a/app/controllers/admin/admin_site_controller.rb
+++ b/app/controllers/admin/admin_site_controller.rb
@@ -1,5 +1,13 @@
 class Admin::AdminSiteController < ApplicationController

   hobo_controller
+
+  before_filter do
+    redirect_to login_url if current_user.guest? || !current_user.administrator
+  end
+
+  def index
+    render :text => "hi"
+  end

-end
\ No newline at end of file
+end
diff --git a/config/routes.rb b/config/routes.rb
index b6ee4ea..6949ee3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,6 +5,8 @@ ActionController::Routing::Routes.draw do |map|

   Hobo.add_routes(map)

+map.admin  'admin', :controller => 'admin/admin_site', :action => 'index'
+
   # The priority is based upon order of creation: first created -> highest prio

   # Sample of regular route:


redirect_to, current_user, render...  none of these appear to be
methods on the Admin::AdminSiteController object.

Has anyone seen this before?

    - Scott

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to