Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add list of categories. Fixes #20, pending test #21.

  • Loading branch information...
commit 7cf70f1a55799062cab417039224232c13c71477 1 parent 84ff894
Terence Ponce authored
7 app/views/articles/show.html.erb
@@ -9,6 +9,13 @@
9 9 <%= link_to @article.author.name, @article.author %>
10 10 <% end %>
11 11 on <%= l(@article.created_at, :format => :friendly_date) %>
  12 + <br />
  13 + <% if @article.categories.any? %>
  14 + <%= @article.categories.count == 1 ? 'Category' : 'Category'.pluralize %>:
  15 + <% @article.categories.each do |category| %>
  16 + <%= link_to category.name, category %>
  17 + <% end %>
  18 + <% end %>
12 19 </small>
13 20 </h1>
14 21 <section class="article-content">
2  spec/requests/articles_pages_spec.rb
@@ -26,6 +26,8 @@
26 26
27 27 it { should have_page_title @article.title }
28 28 it { should have_page_heading @article.title }
  29 + it 'should have the link of the categories'
  30 + # it { should have_link @article.categories.first.name }
29 31 it { should have_link 'Back to articles' }
30 32 it { should_not have_link 'Edit' }
31 33 it { should_not have_link 'Destroy' }

0 comments on commit 7cf70f1

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