11factory / activeadmin-cancan

CanCan integration for ActiveAdmin
MIT License
36 stars 9 forks source link

current activeadmin gem not working with cancan #10

Open ghost opened 11 years ago

ghost commented 11 years ago

if i install the activeadmin gem from the current github repo, then i get that errormessage

NoMethodError - protected method `authorize!' called for #Admin::UsersController:0xa4f301c:

if i go back to official 0.5.1 - working

dont know why.

fedorn commented 11 years ago

I also discovered this. But I think it is activeadmin bug.

greendog commented 11 years ago

http://stackoverflow.com/questions/15703116/activeadmin-can-can-authorization-error

marcusgadbem commented 11 years ago

Yes, I got that error too. Is it really a bug?

I followed the 2 steps described in documentation (http://activeadmin.info/docs/13-authorization-adapter.html#using_the_cancan_adapter) to integrate with CanCan and I get this error:

    ArgumentError in Admin::DashboardController#index
    wrong number of arguments(1 for 0)

My Gemfile is just:

    gem 'rails', '3.2.8'
    gem 'activeadmin'
    gem 'cancan'

Trying the other way around (with AuthorizationAdapter), I get the following error using almost the same code as described in documentation (http://activeadmin.info/docs/13-authorization-adapter.html#setting_up_your_own_authorizationadapter):

    undefined method `normalize' for #<AuthorizationAbility:0x00000101d69668>

I have no technique preference, anyone could fit me. Any thoughts?


Nevermind, guys. Got it working with CanCan and don't know why.

cassioscabral commented 11 years ago

When I change my gemfile to

gem 'activeadmin', :git => 'https://github.com/gregbell/active_admin.git' gem 'cancan'

and removed the code from apllication_controller suggested by active-admin wiki, it worked fine.