Skip to content

Instantly share code, notes, and snippets.

@brandoncc
Created July 8, 2014 17:40
Show Gist options
  • Save brandoncc/87d303de3c62212741b9 to your computer and use it in GitHub Desktop.
Save brandoncc/87d303de3c62212741b9 to your computer and use it in GitHub Desktop.
<div class="row">
<div class="span0 well text-center">
<% if logged_in? %>
<%= link_to vote_post_path(post, vote: true), method: 'post', remote: :true do %>
<i class="icon-arrow-up"></i>
<% end %>
<% end %>
<br>
<span id="post_<%=post.id%>_votes"><%= post.total_votes %> votes</span>
<br>
<% if logged_in? %>
<%= link_to vote_post_path(post, vote: false), method: 'post', remote: true do %>
<i class="icon-arrow-down"></i>
<% end %>
<% end %>
<% if !logged_in? %>
<p><%= link_to "Login to vote", new_user_path %></p>
<% end %>
</div>
<div class='span8 well'>
<% post.categories.each do |category| %>
<span class='badge'><%= link_to category.name, category_path(category) %></span>
<%end%>
<h4><%=link_to post.title.capitalize, post_path(post)%></h4>
<p><%=post.description%></p>
<p><span class='quiet'>posted by: </span><%= link_to "#{post.creator.username}", user_path(post.creator)%></p>
<p><small><%= link_to "#{post.comments.size} comments", post_path(post)%></small></p>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment