开发者

rails 3, when handling a POST from a remote web app, how do we return a basic http "ok"

after processing a upload file received from an external website, we need to send back some sort of basically empty http "ok" message. So we don't have a 'view' associated with this m开发者_开发知识库ethod... I assume we need to do render SOMETHING_GOES_HERE ?


Try using head instead of render:

head 200

From the docs, it looks like you can use more readable symbols instead of numeric HTTP status codes, but I haven't found the list anywhere...

You can also include other headers, if you like (from the docs):

head :created, :location => person_path(@person)

Hope this helps!


render :text => "ok"

You may need to pass :layout => false if there is a layout specified for the entire controller.


render :nothing => true, :status => 200
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜