Skip to content

getting namespace in CanCan::ControllerResource #680

joxxoxo opened this Issue Jul 5, 2012 · 2 comments

2 participants

joxxoxo commented Jul 5, 2012

It parses @params[:controller] for namespace wrong.

    def namespace

There are specs

it "should attempt to load a resource with the same namespace as the controller when using :: for namespace" 
it "should properly load resource for namespaced controller"  # which uses 'admin/projects'

in fact controller name in params uses 'namespace/name' format

so i used monkeypatch which fixed this for me

CanCan::ControllerResource.class_eval do
  def namespace
andhapp commented Jul 5, 2012

@joxxoxo: This was fixed by this pull request (#675) that will be merged into master very soon.

@andhapp andhapp closed this Jul 5, 2012
joxxoxo commented Jul 5, 2012

sorry that i haven't noticed that.
actually i've tried that solution and some specs failed, then i've come to this: #681
could you look at that one too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.