       .success (data) ->
         $('.printer-feedback-alert').hide()
         $('.printer-feedback-success').show()
+        localStorage.setItem(cid_local_storage_key, newCid)
       .error (err) ->
         errors = err.responseJSON.errors
         $('.printer-feedback-alert .msg').html($('<ul/>').html(errors.map (err) -> $('<li/>').text(err)))

# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
printer_local_storage_key = "last-printer-used"

$ ->
  printer_name = localStorage.getItem(printer_local_storage_key)

  if $('#print_printer').length


          $('#pq .name').text(data.username)
          $('#pq .pq').text(data.value)
          $('#pq .success').show()
          localStorage.setItem(cid_local_storage_key, data.username)


    $('.printer-list').on 'click', '.set-printer', ->
