<!DOCTYPE html>
<html>
<head>
  <title>Kandan</title>
  <%= stylesheet_link_tag  "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" %>
  <%= stylesheet_link_tag "http://fonts.googleapis.com/css?family=PT+Sans:400,700" %>
  <%= stylesheet_link_tag  "application", :media => "all" %>

  <%- Kandan::Config.broadcaster.assets.each do |asset| %>
    <%= javascript_include_tag asset %>
  <%- end %>
  
  <%= javascript_include_tag "application" %>
  <%= javascript_tag do %>
    <%- if user_signed_in? %>
      <%- current_user_data = {
            :id   => current_user.id,
            :first_name => current_user.first_name,
            :last_name  => current_user.last_name,
            :auth_token => current_user.authentication_token,
            :gravatar_hash => current_user.gravatar_hash
          }
          %>
      $.data(document, 'current_user', <%= current_user_data.to_json.html_safe %>);
    <%- end %>
  <%- end %>

  <%= javascript_tag do %>
    $(document).data('active_users', [])
  <%- end %>
  
  <%= csrf_meta_tags %>
</head>
<body>

  <%= yield %>

</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <title>Kandan</title>
  <%= stylesheet_link_tag  "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" %>
  <%= stylesheet_link_tag "http://fonts.googleapis.com/css?family=PT+Sans:400,700" %>
  <%= stylesheet_link_tag  "application", :media => "all" %>

  <%- Kandan::Config.broadcaster.assets.each do |asset| %>
    <%= javascript_include_tag asset %>
  <%- end %>
  
  <%= javascript_include_tag "application" %>
  <%= javascript_tag do %>
    <%- if user_signed_in? %>
      <%- current_user_data = {
            :id            => current_user.id,
            :first_name    => current_user.first_name,
            :last_name     => current_user.last_name,
            :email         => current_user.email,
            :auth_token    => current_user.authentication_token,
            :gravatar_hash => current_user.gravatar_hash
          }
          %>
      $.data(document, 'current_user', <%= current_user_data.to_json.html_safe %>);
    <%- end %>
  <%- end %>

  <%= javascript_tag do %>
    $(document).data('active_users', [])
  <%- end %>
  
  <%= csrf_meta_tags %>
</head>
<body>

  <%= yield %>

</body>
</html>

Include current_user.email in the initial page render
Include current_user.email in the initial page render
