I'm new to rails,I've created a customer_details form.when I submit a form by clicking save button It should be saved and redirected to the edit page with all the contents of the form.so that i can download the form using download button. 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
Try this format.html { render 'edit', notice: 'customerDetails was successfully created.' }
format.html { render 'edit', notice: 'customerDetails was successfully created.' }
Tried on my app and it works as expected.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.