Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout link missing :method => 'delete' #248

Closed
wallace opened this issue Jul 3, 2011 · 6 comments
Closed

Logout link missing :method => 'delete' #248

wallace opened this issue Jul 3, 2011 · 6 comments
Assignees
Milestone

Comments

@wallace
Copy link

wallace commented Jul 3, 2011

The logout link, https://github.com/gregbell/active_admin/blob/master/lib/active_admin/views/header_renderer.rb#L30, is missing the :method parameter so a user gets a routing error for '/admin/logout'.

@mksys
Copy link

mksys commented Jul 4, 2011

I get this too - is there an easy fix?

@wallace
Copy link
Author

wallace commented Jul 4, 2011

I thought I fixed it here #249 and I swear I had it work once or twice in a sample application but when I tested it in my application, it still didn't work.

Also, I realized I should've updated the specs to prove it worked. I'm going to keep working on it.

@oponder
Copy link

oponder commented Jul 5, 2011

I think the issue is that active admin isn't loading the jquery rails file (called active_admin_vendor.js in active admin) which is what actually makes the :method => :delete work.

I forked activeadmin to fix this thinking there wasn't much development going on anymore before I realized that there were some really recent commits on the project.

Here is the commit that fixed it for me:
https://github.com/oponder/active_admin/commit/44d89e7180d4d657ddc57c93a7582f36c11042a4

@wallace
Copy link
Author

wallace commented Jul 5, 2011

Thanks @opondor, that explains it. I must've tested my fix in my real application when I still had jquery-rails installed (which I later removed).

I'll see if I can't find some time to create a clean fork using your commit and write a test for it too some time soon.

@libo
Copy link

libo commented Jul 6, 2011

While we wait to a proper fix to the problem I have this patch for /config/routes.rb

devise_scope :admin_user do
    get '/admin/logout', :to => 'active_admin/devise/sessions#destroy'
end

In this way we don't need to mess around with fork and so on...

@chetan-tomar
Copy link

Thanks @libo ...

@ghost ghost assigned gregbell Jul 26, 2011
whatthewhat pushed a commit to whatthewhat/active_admin that referenced this issue Aug 13, 2011
* Updated generator to work with latest Devise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants