In my rails application, the exit link does not work.
I checked my .rb routes, which are listed below, and my application.html.erb looks like this.
Getting the next error.
ActiveRecord::RecordNotFound in UsersController
My routes .rb
Refectory::Application.routes.draw do devise_for :users, :controllers => { :registrations => "users" } devise_scope :user do get 'login', to: "devise/sessions#new", as: "login" get 'logout', to: "devise/sessions#destroy", as: "logout" get 'logout', to: "users/sessions#destroy", as: "logout" get 'signup', to: "users#new", as: "signup" match '/users/:id', :to => 'users#show', :as => :user end root :to => 'tutorials#index' devise_for :users do get '/users/sign_out' => 'devise/sessions#destroy' get 'users/:id' => 'users#show' end resources :tutorials resources :comments, only: [:show, :create, :update, :destroy] resources :tutorials do member { post :vote } end if Rails.env == "development" match 'errors/404' => 'errors#error_404' match 'errors/500' => 'errors#error_500' end unless Rails.application.config.consider_all_requests_local match '*not_found', to: 'errors#error_404' end match 'tagged' => 'tutorials#tagged', :as => 'tagged' end
and my application.html, which seems to be following the correct route from what I see.
Any help is much appreciated!
<% if current_user.present? %> <li><%= link_to "Log out", destroy_user_session_path, (:method => "delete") %></li> <% else %> <li><%= link_to "Log in", new_user_session_path %></li> <li><%= link_to "Sign up", new_user_registration_path %></li> <% end %>
My user controller as well as I suspect this is a problem, but not sure what the error is.
class UsersController < Devise::RegistrationsController def show @user = User.find(params[:id]) @tutorials = @user.tutorials end end
ruby ruby-on-rails devise
Patgw
source share