true\" to show validation errors without reloading the page (because my form is in an overlay)." />
开发者

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

开发者 https://www.devze.com 2023-02-08 11:50 出处:网络
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).

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).

  • Is it possible to redirect to another page after successfull val开发者_开发知识库idation?

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

I'm using rails3 and jquery ujs.


You can do a redirect by javascript.

Add in your js view render in success this code by example :

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

You can replace the url by a named_route or url_for call.

0

精彩评论

暂无评论...
验证码 换一张
取 消