我是rails的新手,我创建了一个customer_details表单。当我通过单击“保存”按钮提交表单时,应该保存并重定向到包含该表单所有内容的编辑页面。我可以使用下载按钮下载表单。This is what im getting after saved the form
def create
@customer_detail = CustomerDetail.new(customer_detail_params)
@customer_detail.company_profile_id = current_user.company_profile.id
respond_to do |format|
if @customer_detail.save
format.html { redirect_to edit_customer_detail_path(@customer_detail), notice: 'customerDetails was successfully created.' }
else
format.html { render :new }
end
end
end
def edit
@customer_details = CustomerDetail.find(params[:id])
end

答案 0 :(得分:0)
试试这个format.html { render 'edit', notice: 'customerDetails was successfully created.' }
尝试使用我的应用,它按预期工作。