activeadmin


undefined method `destroy_user_session_path' for active admin with cancancan and sorcery


HI I am working on rails 4.2.4 app and i am using sorcery for authentication, cancancan for authorization.. so far so good i can login and users can do as well .... I am trying to add activeadmin for admin dashboard I so far set up almost everything but when i fire up the link http://localhost:3000/admin when logged in the app as admin i get the error :
undefined method `destroy_user_session_path' for
:ActiveAdmin::Views::TabbedNavigation
here are my modules:
Activeadmin.rb
ActiveAdmin.setup do |config|
config.site_title = "title goes here"
def authenticate_user!
if !current_user.admin?
redirect_to new_user_session_path
end
end
config.authentication_method = :authenticate_user!
config.current_user_method = :current_user
config.logout_link_method = :delete
config.logout_link_path = :destroy_user_session_path
config.batch_actions = true
config.authorization_adapter = ActiveAdmin::CanCanAdapter
config.localize_format = :long
end
ability.rb
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new
if user.admin?
can :read, ActiveAdmin::Page, :name => "Dashboard"
can :manage, :all
elsif user.client?
can :manage, [Act, Do, Fact, Task, T]
cannot :read, ActiveAdmin::Page, :name => "Dashboard"
else
can :read, Activity
end
can :manage, UserSessionsController do |user_session|
user == user_session
end
if user.active?
can :time, Activity
can :read, ActiveAdmin::Page, :name => "Dashboard"
end
can :log_in, User
can :log_out, User
can :reset_password, User
end
end
destroy in sessions controller
def destroy
authorize! :log_out, User
logout
redirect_to root_url, notice: I18n.t('users.log_out')
end
Can anyone point me on how to solve this .... been stuck here for a while ...
cheers
so after investigating further the correct way is
config.logout_link_path = :user_session_path
But sadly ActiveAdmin don't support urls with ids at logout path at the moment.
see this thread from the activeadmin owner

Related Links

How to filter by “is not” in active admin/ransack
Active Admin image upload with refile
AuthorizationAdapter in ActiveAdmin
ActiveAdmin and Rails Engine. How do you keep the path name the same?
Active admin defining scope for custom page
ActiveAdmin: Can I redirect the user to the index after they create/edit something?
Active admin and Pundit
Sortable for has_many does not sort properly
select2 remove tag_list item
Adding Numeric Range Filtering to ActiveAdmin
undefined method `destroy_user_session_path' for active admin with cancancan and sorcery
Active admin not working in production mode
ActiveAdmin cannot authorize in rails-api project
How can I create an ActiveAdmin filter that will show only objects without a value specified?
jQuery, activeadmin: custom filter with ransack. how to alter displayed text in search box
ActiveAdmin lable name cant be singular

Categories

HOME
flask
eclipse-plugin
adfs3.0
activex
foaf
nsview
yql
dronekit-python
vue-resource
amp
share
supercollider
stored-procedures
port
wine
colors
mailmerge
createjs
phonegap-build
playframework-2.0
maven-plugin
susy-sass
renderscript
libgit2
data-type-conversion
pst
websphere-portal
animated-gif
code-climate
pyspark-sql
counting
express-session
keyboard-layout
rdp
python-sounddevice
spring-restcontroller
right-click
permission-denied
axis
realstudio
intellij-lombok-plugin
viewmodel
xcglogger
cordova-ios
amazon-elastic-beanstalk
solr-query-syntax
skip-lists
sequence-diagram
glassfish-4.1
ltrace
hmmlearn
ternary-operator
multi-touch
openquery
nunit-console
coovachilli
declarative
simian
frame-grab
mnesia
gridbaglayout
vimperator
openmrs
myfaces
enunciate
diawi
python-cffi
bayesglm
arbre
highest
com0com
azure-xplat-cli
nanomsg
google-hangouts
global-scope
git-reset
prism.js
meteor-collections
jack
accountmanager
spring-social-linkedin
compiler-flags
sunstudio
axacropdf
contextswitchdeadlock
red-system
jsplitpane
user-forums
prototypal-inheritance
wcf-callbacks
yuidoc
mmc3
glassfish-esb
fxruby

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App