首页 > 技术文章 > rails Rendering Text 用法

wangyuyu 2021-01-05 15:07 原文

rails5.1版本前用法:

You can send plain text – with no markup at all – back to the browser by using the :text option to render:

render :text => "OK"

rails5.1之后用法:

You can send plain text - with no markup at all - back to the browser by using the :plain option to render:

render plain: "OK"

 

推荐阅读