In your view:
app/views/cats/index.html.erb
<%= render 'map', collection: @cats %>
(With the assumption you have something like this in your controller:
app/controllers/cats_controller.rb
class CatsController < ApplicationController
def index
@cats = Cat.all
end
end
"undefined" appearing when clicking on info window
When you see "undefined" appear in the info window, this means that the wrong attribute is being called on the collection. The partial assumes you'll have an attribute called "name" or "description", but you may store that information in "title" and "body". You can change these values in the start of the partial.