Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement