Should be something like:
json.array!(@photo_feed) do |feed|
json.extract! feed, :id, :username, :photo_filename, :comments_count
json.comments feed.comments do |json, comment|
json.(comment, :username, :comment)
end
end
Check out this railscast - http://railscasts.com/episodes/320-jbuilder