Skip to content

Instantly share code, notes, and snippets.


vanakenm/Posts Sample

Last active Dec 19, 2015
What would you like to do?
<% content_for :header do %>
<%= javascript_include_tag "filters" %>
<% end %>
<h1>Show posts</h1>
<section id="statistics">
<p>Currently <%= @posts.size %> in <%= %> different categories.</p>
<p>Most recent category: <%= @posts.first.category %>
<section id="filters">
<div class="btn-group sort">
<a class="btn dropdown-toogle" data-toogle="dropdown" href="#">All categories <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a data-filter-category="all_filter" href="#">All categories</a></li>
<li><a data-filter-category="opinion" href="#">Opinion</a></li>
<li><a data-filter-category="announcement" href="#">Announcement</a></li>
<li><a data-filter-category="debate" href="#">Debate</a></li>
<% @posts.each do |post| %>
<article data-category="<%= post.category %>">
<h1><%= post.title %></h1>
<h2>By <%= %></h2>
<section class="contents">
<%= post.contents %>
Published on <%= post.publish_date %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment