dchun / QuoteManager

Saas App for Managing Quotes and getting paid
https://quotemanager.boopis.com
0 stars 0 forks source link

Create Redirect Path For Forms #178

Closed dchun closed 9 years ago

dchun commented 9 years ago

Add field to redirect form submissions

phuong3030 commented 9 years ago

https://github.com/boopis/QuoteManager/pull/184

dchun commented 9 years ago

We need to redirect in the requests controller in the create method so if a user adds just the html, the user is still redirected to the path that is defined in the form settings.

Something like:

if form.redirect_link.present?
  format.html { redirect_to form.redirect_link, notice: 'Request was successfully created' }
else
  format.html { redirect_to request.referrer, notice: 'Request was successfully created' }
end

But we also need to set a condition to set the redirect path to quotemanager.co if the form is submitted in the site.

Also, since the redirect call was made in the inline js file, we need to account for that as well.

phuong3030 commented 9 years ago

I think I will add the DOM event level 2 (inline event in html code). User submit the form like creating an ajax to server so we can't control the form redirect by server.