5
我正在使用XML POST登录我的用户,如果身份验证不起作用,我需要返回XML响应。但是,XML响应的格式需要是自定义的,我不能告诉Devise在哪里应该更改此输出。使用Devise自动验证失败的自定义XML响应
在我的“user_sessions_controller.rb”我有香草调用“create”方法:
def create
resource = warden.authenticate!(:scope => resource_name,
:recall => "#{controller_path}#new")
这将返回:
<errors>
<error>Invalid email or password.</error>
</errors>
,但我需要把一个包装解决此:
<AppName>
<errors>
<error>Invalid email or password.</error>
</errors>
</AppName>
美丽的回应,谢谢! – beeudoublez 2012-01-03 03:37:05