true" to...">

Can I redirect after a successful check with form_for: remote => true?

I need advice for a form with: remote => true.

I need "remote => true" to show validation errors without reloading the page (because my form is in an overlay).

  • Can I redirect to another page after a successful Validation?

  • If not, is it possible to use a normal form (without 'remote true'), but to make validation errors without refreshing the page? Maybe I should use javascript validation.

I am using rails3 and jquery ujs.

+4
source share
1 answer

You can do redirects using javascript.

Add rendering to your js view in this example, for example:

window.location = "http://www.google.com/" 

You can replace url by calling named_route or url_for.

+2
source

Source: https://habr.com/ru/post/1338220/


All Articles