Class: NimbleshopStripe::StripesController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/nimbleshop_stripe/stripes_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_stripe/stripes_controller.rb', line 10

def update
  alert_msg = if @payment_method.update_attributes(post_params[:stripe])
                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