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?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜