I'm getting an argument error for Nil location provided when using the image_tag. How do I make the image_tag optional where it only displays if there is a corresponding image? This is with Ruby on Rails 5.
This is my current show page view:
<p id="notice"><%= notice %></p>
<%= image_tag @restaurant.image_url %>
<p>
<strong>Name:</strong>
<%= @restaurant.name %>
</p>
<p>
<strong>Address:</strong>
<%= @restaurant.address %>
</p>
<p>
<strong>Phone:</strong>
<%= @restaurant.phone %>
</p>
<p>
<strong>Website:</strong>
<%= @restaurant.website %>
</p>
<%= link_to 'Edit', edit_restaurant_path(@restaurant), class: 'btn btn-link' %> |
<%= link_to 'Back', restaurants_path, class: 'btn btn-link' %>