Answer the question
In order to leave comments, you need to log in
Why did the exit from the Rails site (devise) stop working?
Hello, please tell me how to fix the error. When leaving the site throws out a message - Couldn't find Doctor with 'id'=sign_out and points to a line @doctor = Doctor.find(params[:id])
in the controller
class DoctorsController < ApplicationController
before_action :set_doctor, only: [:show, :edit, :update, :destroy]
def index
@doctor = Doctor.all
end
def show
@length = User.where(doctor_id: params[:id]).size
end
private
def set_doctor
@doctor = Doctor.find(params[:id])
end
end
Rails.application.routes.draw do
get 'contact/index'
resources :news
resources :prices
get 'healthy/index'
get 'about/index'
resources :users
resources :doctors
devise_for :doctors, :controllers => { registrations: 'registrations' }
root 'users#main'
end
<%= link_to 'Вийти', destroy_doctor_session_path %>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question