   render: ->
     React.DOM.fieldset null,
       React.DOM.label htmlFor: "sort-field-chooser", "Sort by:"
-      React.DOM.select id: "sort-field-chooser", className: "sortFieldChooser", value: @props.sort_by, onChange: @handleChange,
+      React.DOM.select id: "sort-field-chooser", className: "sortFieldChooser", value: @props.field, onChange: @handleChange,
         for [key, name] in SORT_FIELDS
           React.DOM.option key: key, value: key, name
 
   handleChange: (ev) ->
-    updateHash "sort_by", ev.target.value
+    updateHash "sort", ev.target.value
 
 SORT_FIELDS = [
   ["title", "Title"]


  render: ->
    React.DOM.div className: "settings",
      SortFieldChooser(sort_by: @props.settings.sort_by)

SortFieldChooser = React.createClass
  displayName: "SortFieldChooser"

  render: ->
    React.DOM.div className: "app",
      Settings(settings: @state.settings)
      BookList(books: @state.books, sort: @state.settings.sort)

BookList = React.createClass
  displayName: "BookList"

  render: ->
    sortedBooks = _.sortBy @props.books, (b) =>
      if @props.sort.indexOf("rating") isnt -1
        -b[@props.sort]
      else
        b[@props.sort]
    React.DOM.ul className: "book-list",
      BookListItem(key: book.vpl_id, book: book) for id, book of sortedBooks

