Commit df10c5e
Changed files (2)
app
controllers
views
layouts
app/controllers/application_controller.rb
@@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :authenticate!
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
+ helper_method :current_user
protected
app/views/layouts/application.html.erb
@@ -62,11 +62,11 @@
<li><a href="#">Main Item 2</a></li>
<li class="divider"></li>
<li class="has-dropdown">
- <a href="#"><%= gravatar_for(@current_user, size: 16) %> <%= @current_user.username %></a>
+ <a href="#"><%= gravatar_for(current_user, size: 16) %> <%= current_user.username %></a>
<ul class="dropdown">
<li><%= link_to t("nav.user.training_sessions"), training_sessions_path %></li>
- <li><%= link_to t("nav.user.profile_edit"), edit_profile_path(@current_user) %></li>
- <li><%= link_to t("nav.user.profile_view"), profile_path(@current_user) %></li>
+ <li><%= link_to t("nav.user.profile_edit"), edit_profile_path(current_user) %></li>
+ <li><%= link_to t("nav.user.profile_view"), profile_path(current_user) %></li>
<li class="divider"></li>
<li><%= link_to t("nav.user.log_out"), session_path('me'), method: :delete %></li>
</ul>