Created
May 3, 2016 22:11
-
-
Save Killavus/5808aba89b8935da1f3c0df48c1ef3ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomersController < ApplicationController | |
# … | |
def create | |
@customer = Customer.new(customer_params) | |
respond_to do |format| | |
if @customer.save | |
format.html { redirect_to @customer, | |
notice: 'Customer was successfully created.' } | |
format.json { render :show, status: :created, | |
location: @customer } | |
else | |
format.html { render :new } | |
format.json { render json: @customer.errors, | |
status: :unprocessable_entity } | |
end | |
end | |
end | |
# … | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment