Class: NimbleshopAuthorizedotnet::AuthorizedotnetsController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/nimbleshop_authorizedotnet/authorizedotnets_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/nimbleshop_authorizedotnet/authorizedotnets_controller.rb', line 10

def update
  alert_msg = if @payment_method.update_attributes(post_params[:authorizedotnet])
                msg = "Record has been updated"
                %Q[alert("#{msg}")]
              else
                msg =  @payment_method.errors.full_messages.first
                %Q[alert("#{msg}")]
              end

  respond_to do |format|
    format.js { render js: alert_msg }
  end
end