阅读背景:

Rails 3创建方法重定向到索引?

来源:互联网 

I'm having an issue where my article_controller.rb's create method is redirecting to the index when the article.save fails due to invalid input by the user. The articles creation url is /articles/new but when the submit fails, I'm redirected to /articles. The form is still available in /articles exactly as it was on /articles/new. The desired behavior would be to return to the /articles/new with whatever the user may have entered repopulated in the form. Is there a way to do this? Here are some of the code snippets to illustrate what's going on.I'm having an issue where my article_controller




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: