Permalink
Browse files

Handle blank values

  • Loading branch information...
1 parent c0c13f1 commit a68187779e3c1be0f58b1fe63b43e8fba937e126 @brianjlandau brianjlandau committed Nov 18, 2010
Showing with 5 additions and 3 deletions.
  1. +2 −2 app/templates/show_site.mustache
  2. +3 −1 app/views/show_site.rb
@@ -15,10 +15,10 @@
<dd>{{site_email}}</dd>
<dt># of Failures for Tier Two Notification</dt>
- <dd>{{site_threshold_tier_two}}</dd>
+ <dd>{{{site_threshold_tier_two}}}</dd>
<dt>Tier Two Email Address</dt>
- <dd>{{site_email_tier_two}}</dd>
+ <dd>{{{site_email_tier_two}}}</dd>
</dl>
<form action="/sites/{{site_id}}" method="POST" onsubmit="return confirm('Delete this site?')">
View
@@ -4,7 +4,9 @@ class ShowSite < Mustache
attr_reader :site
[:id, :name, :url, :threshold, :email, :email_tier_two, :threshold_tier_two].each do |attribute|
- define_method("site_#{attribute}") { site.send(attribute) }
+ define_method("site_#{attribute}") {
+ site.send(attribute) || '&nbsp;'
+ }
end
def site_match_text

0 comments on commit a681877

Please sign in to comment.