Skip to content

Commit

Permalink
Moved current_user to the application layout. Fixes #158
Browse files Browse the repository at this point in the history
  • Loading branch information
gabceb committed Mar 1, 2013
1 parent a8aece6 commit 331bdc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions app/views/layouts/application.html.erb
Expand Up @@ -11,6 +11,12 @@
<%= yield :javascript_includes %>
<%= csrf_meta_tags %>
<%- if user_signed_in? %>
<%= javascript_tag do %>
$.data(document, "current-user", <%= current_user_data.to_json.html_safe %>);
<% end %>
<%- end %>
</head>
<body>
<div id="kandan">
Expand Down
3 changes: 0 additions & 3 deletions app/views/main/index.html.erb
Expand Up @@ -9,9 +9,6 @@
<%- end %>
<%= javascript_tag do %>
<%- if user_signed_in? %>
$.data(document, "current-user", <%= current_user_data.to_json.html_safe %>);
<%- end %>
$(document).data("active-users", [])
<%- end %>
Expand Down
2 changes: 0 additions & 2 deletions app/views/main/search.html.erb
@@ -1,6 +1,4 @@
<%= javascript_tag do %>
$.data(document, "current-user", <%= current_user_data.to_json.html_safe %>);

$(document).ready(function(){
Kandan.Plugins.initAll()
activities = <%= @activities.to_json(:include => :user).html_safe %>;
Expand Down

0 comments on commit 331bdc1

Please sign in to comment.