<%= link_to "/blog/#{@article.post_url}" do %> <%= image_tag @article.thumbnail.url, :class => "img-responsive img-full-width", :alt => @article.h1_tag %> <% end %>
<%= link_to "/blog/#{@article.post_url}" do %>

<%= @article.title %>

<% end %>

<%= @article.summary %>

  • <%= link_to "/blog/#{@article.anchor_tag.url}", :class => 'author-name' do %> <%= @article.anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @article.content.present? && !@article.content.nil? doc = Hpricot(@article.content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% number_of_articles = 0 @articles.each do |article| number_of_articles = number_of_articles + 1 end %>
<% for i in 0..1 do %> <% if i < number_of_articles %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% end %> <% end %>
<% for i in 2..3 do %> <% if i < number_of_articles %> <% if i == 2 %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% else %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% end %> <% end %> <% end %>
<% for i in 4..5 do %> <% if i < number_of_articles %> <% if i == 4 %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% else %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% end %> <% end %> <% end %>
<% for i in 6..7 do %> <% if i < number_of_articles %>
<%= link_to "/blog/#{@articles[i].post_url}" do %> <%= image_tag @articles[i].thumbnail.url, :class => "img-responsive" %> <% end %> <%= link_to "/blog/#{@articles[i].post_url}" do %>

<%= @articles[i].title %>

<% end %>
  • <%= link_to "/blog/#{@articles[i].anchor_tag.url}", :class => 'author-name' do %> <%= @articles[i].anchor_tag.name %> <% end %>
  • <% read_time = "4 MIN READ" if @articles[i].content.present? && !@articles[i].content.nil? doc = Hpricot(@articles[i].content) words = doc.inner_text.split.count if words > 0 read_time = "#{words/200} MIN READ" end end %>
  • <%= read_time %>
<% end %> <% end %>
<%= will_paginate @articles, :previous_label => " < ", :next_label => " > " %>