       self.openDialog()
       false
     )
-    # button
-    $('#exchange_rate').live "change", -> self.setExchange()
+
   # Events
   events:
-    "click button": "setExchange"
+    "click button": "closeDialog"
   # Label
   setLabel: ->
     @label.find("span.rate_details").html('')

  setExchange: ->
    rate = ($(@el).find("#exchange_rate").val() * 1).round(4)
    @model.set({exchange_rate: rate})
    @.closeDialog()
  # present dialog
  openDialog: ->
    $(@el).find("#exchange_rate").val(@model.get("exchange_rate"))
    $(@el).find("span.currency_symbol").html(@model.get("currency_symbol"))
    $( @el ).dialog("open")
  closeDialog: ->
    $( @el ).dialog("close")

window.ExchangeRateDialog = ExchangeRateDialog


      autoOpen: false
      title: 'Tipo de cambio'
      id: 'currency_dialog'
      width: 500
      position: 'center'
      modal: true
      close: (event, ui)->
        $(this).hide()
        $('#exchange_rate').trigger("change")
