Skip to content
Browse files

Ensure logged in before accessing current_user

  • Loading branch information...
1 parent c9224bb commit 719b3d76b3c8e42efb5f1955d222d18f187773b0 @mattyoho mattyoho committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/views/feeds/show.html.haml
View
2 app/views/feeds/show.html.haml
@@ -8,7 +8,7 @@
%strong= link_to(feed_item.username, feed_item.feed)
= distance_of_time_in_words_to_now(feed_item.created_at) + " ago"
%div.feed-item= render partial: feed_item, as: :feed_item
- - if current_user.created?(feed_item)
+ - if logged_in? && current_user.created?(feed_item)
= link_to 'Edit', edit_feed_item_path(feed_item), class: "btn"
= link_to 'Destroy', feed_item_path(feed_item), :confirm => 'Are you sure?', :method => :delete, class: "btn btn-danger"

0 comments on commit 719b3d7

Please sign in to comment.
Something went wrong with that request. Please try again.