Skip to content

Commit

Permalink
Add display purchase helper (p91)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanbibat committed Sep 3, 2011
1 parent d455153 commit 3e18bdd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/helpers/invoices_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
module InvoicesHelper
def display_purchase(invoice)
unless invoice.purchase.nil?
invoice.purchase.description
else
"(no Purchase set)"
end
end
end
2 changes: 1 addition & 1 deletion app/views/invoices/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p>
<b>Purchase:</b>
<%= @invoice.purchase %>
<%= display_purchase(@invoice) %>
</p>

<p>
Expand Down

0 comments on commit 3e18bdd

Please sign in to comment.