I am building my first Ruby on Rails application (ruby 2.0.0p353) following the guidance of teamtreehouse.com .
I use dev 3.2.2 devise and in application.html.erb I want to use devuse "current_user" to display the name of the logged in user.
Here is the code in which I use "current_user":
<ul class="nav navbar-nav pull-right">
<li><%= link_to current_user.first_name, "#" %></li>
<li><%= link_to "Log Out", destroy_user_session_path, method: :delete %></li>
</ul>
routes.db:
Treebook::Application.routes.draw do
devise_for :t_busers
resources :statuses
root to: 'statuses#index'
end
However, when I launch my application, I always get the following error:
undefined local variable or method `current_user' for #<#<Class:0x007f98b1d0edb8>:0x007f98b1cff6d8>
. , . , .., , . "before_filter: authenticate_user!". application_controller.rb, , .
-, , ?