0
votes

Couldn't find User with 'id'=8

Extracted source (around line #13):

def current_user 
  @current_user ||= User.find(session[:user_id]) if session[:user_id] 
end

def require_user 

Rails.root: C:/Users/AB COMPUTER/SecureSite

Application Trace | Framework Trace | Full Trace app/controllers/application_controller.rb:13:in current_user' app/controllers/application_controller.rb:17:inrequire_user' Request

1
The error kind of gives it away. You do not have a user with id of 8Jon
Just refresh your chrome cache, or create a user with the id of 8 in your rails consoleRichard Peck
i know that error message say that but when i try to create a new user with id:8 i get the same error and seed.rb couldn't update , the problem begin when i update db:migrate with db:rollback and old user with id 8 deleted.Musa Abdillah

1 Answers

1
votes

This error tells you that you do not have a user with an id of 8.

Open your browser developer tools and clear the sessions/cookies and try again, in chrome you will find those under Resources tab.