It's the weirdest thing, my app was working fine a couple of weeks
ago, when I took a break to work on another project. Now when I try to
access the admin subsite, it seems to be returning nil from login_url.
I don't think I updated any gems in the meantime (although I have
updated to the latest hobo gem to see if it fixes the problem and it
didn't).

Here is the filter I have to handle the login requirement:

In /app/controllers/admin/admin_site_controller.rb:

 before_filter :admin_required

  def admin_required
    redirect_to login_url unless logged_in? &&
current_user.administrator?
  end

Here's the error I'm getting when I try to go to http://localhost:3000/admin
:

Processing Admin::AdminSiteController#index (for 127.0.0.1 at
2009-05-27 19:06:47) [GET]

ActionController::ActionControllerError (Cannot redirect to nil!):
    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
base.rb:1057:in `redirect_to_without_object_url'
    /vendor/plugins/hobo/hobo/lib/hobo/controller.rb:61:in
`redirect_to'
    /app/controllers/admin/admin_site_controller.rb:16:in
`admin_required'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/
callbacks.rb:178:in `send'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/
callbacks.rb:178:in `evaluate_method'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/
callbacks.rb:166:in `call'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
filters.rb:225:in `call'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
filters.rb:629:in `run_before_filters'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
filters.rb:615:in `call_filters'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
filters.rb:638:in `run_before_filters'
(etc)


I also get a routing error when trying to go to http://localhost:3000/login:

No route matches "/login" with {:method=>:get}

Any help would be greatly appreciated!

Best regards,
Jarin udom
--~--~---------~--~----~------------~-------~--~----~
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