diff --git a/app/controllers/customers_controller.rb b/app/controllers/customers_controller.rb index c8f998f..1313309 100644 --- a/app/controllers/customers_controller.rb +++ b/app/controllers/customers_controller.rb @@ -60,13 +60,13 @@ class CustomersController < ApplicationController def update begin @customer = Customer.find_by_id(params[:id]) - if @customer.update_attributes(params[:vehicle]) + if @customer.update_attributes(params[:customer]) flash[:notice] = "Customer updated" redirect_to @customer else redirect_to edit_customer_path + flash[:error] = @customer.errors.full_messages.to_sentence if @customer.errors end - flash[:error] = @customer.errors.full_messages.to_sentence if @customer.errors rescue ActiveRecord::RecordNotFound render_404 end