I have this code:
<% if @states.count > 0 %> # @states is an active record collection
I just feel like there should be a better way to write this.
I am looking for something like:
<% if @states.not_empty? %>
I realize this is tiny change but it would be a welcome cleanup.
You probably want ActiveRecord’s
any?http://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-any-3F