ruby输出文本的几种方法

模板使用指南
http://guides.rubyonrails.org/layouts_and_rendering.html

使用模板
render template: "products/show"
输出文件内容
render file: "/u/apps/warehouse_app/current/app/views/products/show"
输出HTML
render html: "Not Found".html_safe
输出文本
render plain: "OK"
输出JSON
render json: @product