I have a search controller something like this:
def index @foos = Foo.search @bars = Bar.search @search = [@foos, @bars] end And in my search index:
<% @search.each do |s| %> <% s.each do |s| %> <% s.name %> <% end %> <% end %> How can I write an if statement to find arrays only from the Foo model?
<% if s.modelname == "Foo" %> ? Setting <%= s.each do %> shows that the array does have it's model name.