I am using Rails and Devise in a Rails application.
In my code, I am trying to use current_user in layouts/_header.html.erb.
<% Rails.logger.debug("Time is: #{Time.now} - Current User: #{current_user}") %>
When I use Firefox on my MAC to run the application, here's what I have in the log file:
Time is: 2013-06-18 16:21:42 - Current User: #<User:0x007fae442cf020>
When I use Chrome on my MAC to run the application, here's what I have in the log file:
Time is: 2013-06-18 16:20:33 - Current User:
Rendered layouts/_promo_bar.html.erb (3.4ms)
Completed 500 Internal Server Error in 657ms
ActionView::Template::Error (undefined method `email' for nil:NilClass):
27: <div class="promo-bar-box last-right-box">
28: <div class="request-invitation-text">
29: <% Rails.logger.debug("Time is: #{Time.now} - Current User: #{current_user}") %>
30: <% reg_user = user_registered_for_event(current_user.email) %>
app/views/layouts/_promo_bar.html.erb:30:in `_app_views_layouts__promo_bar_html_erb__785786602602486184_70193263335300'
Any ideas?