 <p>From the error message it seems like your <strong>@users</strong> is not an array or <strong>ActiveRecord::Relation</strong>.</p> <p>I would print out the @users on the view to debug. Also, <code>find(:all, :conditions =&gt; ["status = ?", "online"])</code> is not the preferable way to query.</p> <p>Use <code>User.where(:status =&gt; "online")</code>. Reference - <a href="http://guides.rubyonrails.org/active_record_querying.html#conditions" rel="nofollow">http://guides.rubyonrails.org/active_record_querying.html#conditions</a></p>