Check if the there is no records found

In the controller
@properties = Property.paginate :page => params[:page], :order =>
'created_at DESC'

in the view
I have tried
<% if !$properties.blank? %>
<%= render :partial => "show_properties_list" %>
<%else%>
<h3>no records found</h3>
<%end%>
but it did not work
also, I have tried empty? and not [] {}

all of them did not work

could someone tell me what I am doing wrong

You might want to change the dollar sign to an @
  <% if !@properties.blank? %>

Hey Mohammed,

You’ve used a $ sigil instead of @

Also, to maybe help it read better, don’t use the ! (not) and then you can change the contents of the if, else parts.

As a developer, that reads better. More intuitive. Just my opinion.

<% if @properties.blank? %>

no records found

<%else%>

<%= render :partial => “show_properties_list” %>
<%end%>

personally, I find
  @properties.present?
to be more readable than
  !@properties.blank?