Commit ee4cc11d

mo k <m@mokhan.ca>
2012-01-08 03:26:26
check if the user is signed in before displaying the like button.
1 parent 23e9abe
Changed files (1)
app
views
creations
app/views/creations/show.html.erb
@@ -36,8 +36,10 @@
       </div>
       <div class="span2">
         <!-- <iframe src="http://www.facebook.com/plugins/like.php?href=<%= request.url %>" scrolling="no" frameborder="0" style="border:none; width:350px; height:30px"></iframe> -->
-        <% unless current_user == @creation.user || current_user.already_likes(@creation) %>
-          <%= button_to "Like", creation_likes_path(:creation_id => @creation.id), :method => :post, :class => 'btn success' %>
+        <% if user_signed_in? %>
+          <% unless current_user == @creation.user || current_user.already_likes(@creation) %>
+            <%= button_to "Like", creation_likes_path(:creation_id => @creation.id), :method => :post, :class => 'btn success' %>
+          <% end %>
         <% end %>
       </div>
     </div>