     return
 
   router.on "route:viewPersonResults", (querystring) ->
-    console.log querystring
     peopleSearchResultsView = new PeopleSearchResultsView()
-    peopleSearchResultsView.render querystring
+    peopleSearchResultsView.search querystring
     return
 
 

      return
  )

  PeopleSearchResultsView = Backbone.View.extend(
    el: "#page",
    render: (querystring) ->
      that = @
      peopleResults = new PeopleSearch
      peopleResults.fetch
        #dataType: "jsonp"
        url: "/peoplesearch?" + querystring
        success: (people) ->

          breadcrumb_template = _.template($("#breadcrumb-template").html(),
            breadcrumbs: [{"Search"},"Results - " + people.models.length]
          )
          $("#breadcrumb").html breadcrumb_template
          that.$el.empty()

          require [
            "backgrid"
          ], (Backgrid) ->
            peopleGrid = new Backgrid.Grid(
              columns: [
                {
                  name: "surname"
                  cell: "string"
                  sortable: true
                  editable: false
                }
                {
                  name: "forenames"
                  cell: "string"
                  sortable: true
                  editable: false
                }
                {
                  name: "sex"
                  label: "gender"
                  cell: "string"
                  sortable: true
                  editable: false
                }
                {
                  name: "id"
                  label: "URL"
                  cell: Backgrid.UriCell.extend(events:
                    click: "viewPerson"
                  )
                  sortable: false
                  editable: false
                }
              ]
              collection: people
            )
            that.$el.append peopleGrid.render().el

  )


  #because peopleListView is special, we need to have this outside of the init router, otherwise it doesn't work when we call a subpage directly etc.
  router.on "route:home", ->
    peopleListView = new PeopleListView()
    return

  router.on "route:searchForm", ->
