使用的时候
Class TestController < ApplicationController
def index
value=CACHE.get(“testkey”)
if value!=nil
render :text=>"<h1>成功 : ”+value+”</h1>"
else
render :text=>”<h1>失敗</h1>”
end
end
end
以下转自Corey:ruby中星号(*)的作用(http://wuhuizhong.iteye.com/blog/219540)
4.创建数组
Ruby代码
*a = 1,3,"as"
a = [1,3, "as"]
*a = 1,3,"as"
a = [1,3, "as"]