OSDN Git Service

reapir users session on application layout
authoryasushiito <yasushiito@git.sourceforge.jp>
Tue, 27 Mar 2012 08:14:24 +0000 (17:14 +0900)
committeryasushiito <yasushiito@git.sourceforge.jp>
Tue, 27 Mar 2012 08:14:24 +0000 (17:14 +0900)
app/views/layouts/application.html.erb

index 0b872d3..8334602 100644 (file)
                </div>\r
                <%= javascript_include_tag "common" %>\r
                <%= javascript_include_tag "jquery-1.6.2.min" %>\r
                </div>\r
                <%= javascript_include_tag "common" %>\r
                <%= javascript_include_tag "jquery-1.6.2.min" %>\r
-               <%if current_author %>\r
+               <%if current_user %>\r
                  <script>\r
                    current_author = {\r
                  <script>\r
                    current_author = {\r
-                     id: <%= current_author.id %>,\r
-                     name: "<%= h current_author.name %>"\r
+                     id: <%= @author ? @author.id : 0 %>,\r
+                     name: "<%= @author ? h(@author.name) : '' %>"\r
+                   }\r
+                   current_artist = {\r
+                     id: <%= @artist ? @artist.id : 0 %>,\r
+                     name: "<%= @artist ? h(@artist.name) : '' %>"\r
                    }\r
                  </script>\r
                <% end %>\r
                    }\r
                  </script>\r
                <% end %>\r