我的问题是每当我打字创建一个新对象时,表单会自行刷新并且无法将其保存到数据库
String lastSentence=somethingalreadydoneabove;
String upperCase=lastSentence.toUpperCase();
端
# POST /customers
# POST /customers.json
def create
respond_to do |format|
@refund = Refund.all.map{ |c| [c.status, c.id]}
@customer = current_user.customers.build(customer_params)
@customer.refund_id = params[:refund_id]
if @customer.save
format.html { redirect_to @customer, notice: "You have successfully added a refund for #{@customer.last_name}." }
format.json { render :show, status: :created, location: @customer }
else
format.html { render :new }
format.json { render json: @customer.errors, status: :unprocessable_entity }
end
end
##