Rescue - how to supress a nil NoMethodError
This is pretty easy, but I always seem to forget (see comment):
<%= @post.author.name rescue "no author" -%>
codes a lot
If the code is inexplicably missing from some of my posts it is because gist.github.com is down at the moment. Check back a little later.
This is pretty easy, but I always seem to forget (see comment):
<%= @post.author.name rescue "no author" -%>