You can call any model from your LocationsController:
class LocationsController < ApplicationController
def index
@chefs = Chef.all
@chef = Chef.find(params[:id])
@locations = Location.all
@location = Location.find(params[:id])
end
end
If you want to call a chef's name in the view:
@location.chefs.each do |chef|
<%= chef.name %>
end
It all depends what type of content you're trying to render, but it's best to call models directly in the controller unless certain associations are required.
@location.chefs.each do |chef|
if !chef.name.blank?
<%= chef.name %>
end
end