render(:text => string) 输出字符串:
render(:text => cookies[:test_cookies].to_s)
render(:text => "字符串")
render(:action => action_name)调用action()方法:
render(:action => :index)
render(:template => template_name)显示模板:
render(:template => "test/index")
render(:file => path)显示指定文件:
render(:file => "D:/ruby/projects/test/app/views/test/index.rhtml")
render(:file => "test/index",:use_full_path => true)
render(:nothing => true)返回空值:
render(:nothing => true)
动态生成模板并显示数据:
render :inline => "", :locals => { :word => "World"},:type => "rhtml"
render(:partial => path)调用局部模板:
render(:partial => "partial/title", :object => @first_item)