更新时间:2023-02-07 12:30:56
您的控制器将如下所示:
Your controller would then look something like:
class WelcomeController < ApplicationController
def iframe
load_channels
render :partial => "news", :layout => "iframe"
end
end
然后创建一个新的精简版式,名为"_iframe.html.erb"(或.haml或您使用的任何格式),仅包含资产和收益"(如果复制应用程序版式并删除部件,则很容易您不需要).
And then you create a new stripped down layout named "_iframe.html.erb" (or .haml or whatever you use) containing only your assets and the "yield" (easy if you copy your application layout and remove the parts you don't need).
请继续阅读: http://guides.rubyonrails.org/layouts_and_rendering.html 如果需要