English 中文(简体)
如何在铁路3号设计上对登记错误作出不同规定?
原标题:How to render a different layout on registration error with devise in rails 3?

我正在使用有设计的铁路3号,在设计登记有错误时,我想造成特殊的麻省错误。 如果存在错误,怎么能够制定登记行动,回去一间制造的麻风 lay布?

最佳回答

即便如此,这还是帮助任何其他人。 我发现,我可以提出与设计档案相匹配的“js.erb”文档,并且可以将其称作遥远。 由于某种原因,除了登记表外,这项工作还在进行。 在这种形式上,我不得不在我的布局中添加这一守则。

respond_to do |format|
  # format.js { "application" }
  format.js   { "../devise/registrations/new" }
  format.html { "application" }
end
问题回答

您可以运行:

  rails generate devise:views

你们的表/表将提出所有意见。

From there you can edit the views to whatever you want(including your ajax response).

您也可能需要编辑控制器,然后才能读到:

https://github.com/plataformatec/devise

在他们谈论配置习惯控制器的地方。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签