Skip to content

Commit

Permalink
Remove posts helper
Browse files Browse the repository at this point in the history
  • Loading branch information
enricostano committed Aug 22, 2018
1 parent 6e8a71a commit 7de19ac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
13 changes: 0 additions & 13 deletions app/helpers/posts_helper.rb

This file was deleted.

8 changes: 5 additions & 3 deletions app/views/shared/_post.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
<div class="panel-body">
<%= l post.updated_at.to_date, format: :long %>
<p></p>
<%= link_to get_index_path(post, cat: post.category) do %>
<%= glyph :folder_open %>
<%= link_to [post.class, cat: post.category] do %>
<%= glyph(:folder_open) %>
<%= post.category %>
<% end %>
<p></p>
<% if post.tags.present? %>
<% post.tags.each do |tag| %>
<span class="badge alert-success">
<%= glyph(:tag) %>
<%= link_to tag, get_index_path(post, tag: tag) %>
<%= link_to [post.class, tag: tag] do %>
<%= tag %>
<% end %>
</span>
<% end %>
<% end %>
Expand Down
8 changes: 6 additions & 2 deletions app/views/shared/_posts.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
<% if post.category %>
<%= glyph :folder_open %>
<span class="category">
<%= link_to post.category, get_index_path(post, cat: post.category) %>
<%= link_to [post.class, cat: post.category] do %>
<%= post.category %>
<% end %>
</span>
<% end %>
<% (post.tags || []).each do |tag| %>
<%= glyph :tag %>
<%= link_to tag, get_index_path(post,tag: tag) %>
<%= link_to [post.class, tag: tag] do %>
<%= tag %>
<% end %>
<% end %>
</small>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/_grouped_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="badge">
<%= count %>
</div>
<%= link_to get_index_path(post_type.pluralize, tag: tag) do %>
<%= link_to [post_type.pluralize, tag: tag] do %>
<%= glyph count == 1 ? :tag : :tags %>
<%= tag %>
<% end %>
Expand Down

0 comments on commit 7de19ac

Please # to comment.