Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用了:
render_to_string(:controller=>:controllerName,:action=>:actionName)
但这只会给我页眉和页脚的内容,而不是该特定页面的实际内容。
还有其他方法吗?
谢谢
我用过
@var = render_to_string(:file => "view_folder/index", :layout => false).to_json
从render_to_string获取数据,它工作正常..
@var = render_to_string(:template => "controller/action", :layout => false)