You can clone with
No one assigned
I'm trying to load the resources using either load_resource or load_and_authorize_resource, but it doesn't seem to load the resource at all. I keep getting errors in my rspec controller test that @companies is nil or in my cucumber test that i can't cycle through @companies cause it's nil.
I'm using cancan straight from github repo at rev b4285ae
class CompaniesController < ApplicationController
# @companies = current_user.companies
@company = Company.new
I'm not sure if this will ultimately solve your problem (depending on the rest of your code), but the way you're currently using load_resource will not fetch companies from current_user. In order to fetch companies as a nested resource, you'll need to add a :through => :current_user attribute on load_resource, like so:
:through => :current_user
load_resource :through => :current_user
Still not working. It doesn't seem to load the resource at all, still.
Hey, is this still an issue?
As far as I know. I haven't tried again, still waiting for someone to take a look at this issue.
I recommend trying again with the most recent version of the gem to make sure it hasn't been fixed elsewhere.
If that doesn't help, please post your ability.rb file as well as the current_user method that CanCan relies on. The model file (which I assume is company.rb) would also be useful.