0
我是Ruby on Rails的新手。ROR 2.x动态部分
在动作,我需要动态生成的局部与编码的内容并将其显示为经由数据-URI弹出:
控制器
def dashboard
@surprise = get_deal(srand % current_user.dob_year)
end
def get_deal(magic_number)
if magic_number < 500
return "<h5>You have won a voucher #{VoucherFactory.unused_in_the_queue}</h5>"
end
end
现在,鉴于我需要的东西如:partial=>@surprise
而不保存文件。