Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def create
@rental_agreement = RentalAgreement.new(params[:rental_agreement])
# UserMailer.rental_email(current_user, @rental_agreement.tool_id).deliver
respond_to do |format|
if @rental_agreement.save
format.html { redirect_to rental_agreement_path(id: @rental_agreement.id), notice: 'Rental agreement was successfully created.' }
format.json { render json: @rental_agreement, status: :created, location: @rental_agreement }
else
format.html { render action: "new" }
format.json { render json: @rental_agreement.errors, status: :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.