Returning from rails controller

こ雲淡風輕ζ 提交于 2019-12-03 03:41:11
Lee Hambley

You can use "render :nothing => true, :status => :ok" to return without rendering anything, once you have send a render :nothing => true you need to return from the controller, something like this might work. You can swap the head() method call for a render => :nothing followed by a return, the head() method is documented here:

Here's the code that should do it for you...

Ping me if that doesn't properly answer your question, documentation for the render call with some helpful user comments can be found here:

(sorry I couldn't hyperlink the links for you, as a new user stackoverflow won't allow me to post more than one!)

Use

render :nothing => true, :status => :ok

in your action method

I guess you must be asking for :

render :nothing => true
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!