halogenandtoast/oath

filter redirect fails when called in namespaced controller

petertellgren opened this issue · 1 comments

I'm working on an app where I've separated som functionality and UI concerns by namespacing some controllers within my routes config as follows.

resource :session, only: [:create, :destroy, :new]
namespace :author do
    root 'base#index'
    resource :profile, only: [:show, :update]
end

my author section requires a login so the filter :require_login is used and I've setup the controllers as follows:

class ApplicationController < ActionController::Base
  include Monban::ControllerHelpers
end

class Author::BaseController < ApplicationController
    before_filter :require_login
end

class Author::ProfilesController < Author::BaseController
end

However when the filter triggers the redirect it throws the following error:

ActionController::UrlGenerationError in Author::ProfilesController#show
No route matches {:action=>"new", :controller=>"author/sessions"}

Any suggestions on how I properly solve this or am I going about my app setup the completely ass-backwards ? Any comments are welcome.

This was actually my bad. I've pushed a new version of the gem which fixes this problem, you should just need to update to 0.0.9