1json.array!(@agents) do |agent| 2 json.extract! agent, :id, :hostname 3 json.url agent_url(agent, format: :json) 4end