controller
@articles = current_user.articles
view
<% @articles.each do |article| %>
<%= link_to "#{article.title} , #{article.author.name}" articles_path%>
<% end %>
Sometimes the article has no author, so is null in the database, which results in the following error
You have a nil object when you didn't expect it! The error occurred while evaluating nil.name
I still want to output the article title in this scenario, whats the best way to do this please?