Although I don't know the cause, the reason why you are getting that message is because in your routes you have.
Up vote 4 down vote favorite 1 share g+ share fb share tw.
Here is my actual error: No route matches GET "/members/sign_out" Since most people will use "users" I thought it would be more helpful to have that in the title. At any rate, I am essential unable to logout. I can successfully edit my member profile.
I am using devise 1.4.2 and Rails 3.1.0. Rc4. Also, I have generated two separate devise models - one called "members" and the other called "admins".
I was able to register and log into both of them (simultaneously) by manually navigating to the correct URL path (i.e. , localhost:3000/admins/sign_in/). I created some links within my application.html.
Haml layout file by following this RailsCast on Devise. I am aware that it only addresses signin/signout links for "members. " If I click on the signout link I get the above error.
This occurs if I manually navigate to either signout URL (i.e. , localhost:3000/admins/sign_out/). Can someone tell me why this is happening?
Below are the various related files. And of course, I'm a newbie... rake routes output: j(film_repo)$ rake routes new_member_session GET /members/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"} member_session POST /members/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"} destroy_member_session DELETE /members/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"} member_password POST /members/password(.:format) {:action=>"create", :controller=>"devise/passwords"} new_member_password GET /members/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"} edit_member_password GET /members/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"} PUT /members/password(.:format) {:action=>"update", :controller=>"devise/passwords"} cancel_member_registration GET /members/cancel(.:format) {:action=>"cancel", :controller=>"devise/registrations"} member_registration POST /members(.:format) {:action=>"create", :controller=>"devise/registrations"} new_member_registration GET /members/sign_up(.:format) {:action=>"new", :controller=>"devise/registrations"} edit_member_registration GET /members/edit(.:format) {:action=>"edit", :controller=>"devise/registrations"} PUT /members(.:format) {:action=>"update", :controller=>"devise/registrations"} DELETE /members(.:format) {:action=>"destroy", :controller=>"devise/registrations"} new_admin_session GET /admins/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"} admin_session POST /admins/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"} destroy_admin_session DELETE /admins/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"} admin_password POST /admins/password(.:format) {:action=>"create", :controller=>"devise/passwords"} new_admin_password GET /admins/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"} edit_admin_password GET /admins/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"} PUT /admins/password(.:format) {:action=>"update", :controller=>"devise/passwords"} cancel_admin_registration GET /admins/cancel(.:format) {:action=>"cancel", :controller=>"devise/registrations"} admin_registration POST /admins(.:format) {:action=>"create", :controller=>"devise/registrations"} new_admin_registration GET /admins/sign_up(.:format) {:action=>"new", :controller=>"devise/registrations"} edit_admin_registration GET /admins/edit(.:format) {:action=>"edit", :controller=>"devise/registrations"} PUT /admins(.:format) {:action=>"update", :controller=>"devise/registrations"} DELETE /admins(.:format) {:action=>"destroy", :controller=>"devise/registrations"} films GET /films(.:format) {:action=>"index", :controller=>"films"} POST /films(.:format) {:action=>"create", :controller=>"films"} new_film GET /films/new(.:format) {:action=>"new", :controller=>"films"} edit_film GET /films/:id/edit(.:format) {:action=>"edit", :controller=>"films"} film GET /films/:id(.:format) {:action=>"show", :controller=>"films"} PUT /films/:id(.:format) {:action=>"update", :controller=>"films"} DELETE /films/:id(.:format) {:action=>"destroy", :controller=>"films"} root / {:controller=>"films", :action=>"index"} routes. Rb FilmRepo::Application.routes.
Draw do devise_for :members devise_for :admins resources :films root :to => 'films#index' end admin. Rb (model) class Admin 'screen, projection' = stylesheet_link_tag 'compiled/print. Css', :media => 'print' /if lt IE 8 = stylesheet_link_tag 'compiled/ie.
Css', :media => 'screen, projection' = csrf_meta_tag %body. Bp #container #user_nav - if member_signed_in? Signed in as #{current_member.
Email}. Not you? \#{link_to "Sign out", destroy_member_session_path} - else = link_to "Sign up", new_member_registration_path or #{link_to "sign in", new_member_session_path} - flash.
Each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}" = yield authentication devise ruby-on-rails-3.1 link|improve this question edited Jul 4 '11 at 6:20 asked Jul 4 '11 at 6:07J. Venator176210 20% accept rate.
Although I don't know the cause, the reason why you are getting that message is because in your routes you have destroy_member_session DELETE /members/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"} Which means that route is only available with the DELETE method as opposed to GET. This is a bit weird since in the docs for devise it says that it should create it as GET route (github.com/plataformatec/devise/blob/mas...) With it as a DELETE route, you should be able to logout using link_to :logout, destroy_member_session_path, :method => :delete.
2 I posted an issue in their github repo and they gave me the same fix. If you pass :delete %> it will work. – Mark Sands Jul 12 '11 at 3:05.
I had a similar problem, but addition of the :method=> :delete didn't work. I was able to add a new route for a the get request by commenting out the devise_for :users and adding devise_for :users do get '/users/sign_out' => 'devise/sessions#destroy' end.
After trying a whole host of solutions to what appears to be a pretty common problem, this is the only one that actually worked. – Sean Cameron Aug 30 '11 at 9:18 Worked just fine for me, thanks a lot! – Gedean Dias Oct 22 '11 at 19:11.
You can end a session via get by changing the devise configuration in initializers. # The default HTTP method used to sign out a resource. Default is :delete.
Config. Sign_out_via = :get Just open the link and your session is removed.
1 +1 for the proper way yo solve this. This is in . /config/initializers/devise.rb.
– Tudorizer Nov 16 '11 at 13:28 If you got this far, you probably know this, but be sure to restart your rails server (even in development) after making this change. – Troy Mar 6 at 17:20.
FWIW I have also run into this problem. Have looked into all of the suggested answers however the only one which worked was to foto open routes. Rb and comment out the following line: devise_for :users Below that, add the following line: devise_for :users do get '/users/sign_out' => 'devise/sessions#destroy' end.
Thank you. Save my day. – HelloWorld Feb 28 at 8:50.
You may have removed assets/javascripts/* Run rails generate jquery:install --ui this will generate all the javascripts as shown below xxxx@xxxxx:~/Projects/Rails_apps/rtest$ rails generate jquery:install --ui remove public/javascripts/prototype. Js remove public/javascripts/effects. Js remove public/javascripts/dragdrop.
Js remove public/javascripts/controls. Js copying jQuery (1.7.1) create public/javascripts/jquery. Js create public/javascripts/jquery.min.
Js copying jQuery UI (1.8.16) create public/javascripts/jquery-ui. Js create public/javascripts/jquery-ui.min. Js copying jQuery UJS adapter (822920) remove public/javascripts/rails.
Js create public/javascripts/jquery_ujs. Js Go to your layout e. G application.html.
Erb and edit That worked for me :).
Had the same problem and remembered it only started happening after I decided to "clean up" my Javascript files. So I ran rails generate jquery:install --ui again and this solved it for me. (You can ignore the --ui part if you don't need JQuery UI, I suppose.
).
The problem begin with rails 3.1... in assets/javascript/ just look for application. Js, if the file doesn't exists create a file with that name I don't know why my file disappear or never was created on rails new app... that file is the instance for jquery... regards.
Maybe that will help somebody. Upgraded from Rails 3.0 to 3.1 and found this problem. This fixed it for me: routes.
Rb: devise_for: users devise. Rb: config. Sign_out_via = :delete application.html.
Erb: * not :defaults _login_items.html. Erb: :delete) %> app/assets/javascripts/application. Js //= require jquery //= require jquery-ui //= require jquery_ujs //= require_tree .
And I had in javascript/ jquery. Js, jquery_ujs. Js from 3.0 version that I've removed.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.