I am trying to tell ruby to not run a block of html and ruby if no active record exists in the database. Below is the code I was trying to run conditions on.
<% if @statemant.comments.exists?() do %>
<div id="comments">
<h2>Comments</h2>
<%= render :partial => @statemant.comments %>
</div>
<% end %>
You need to get rid of the
dofrom yourifstatement (you can optionally replace it withthen).dois used for blocks.ifisn’t a function, so it doesn’t take a block.