现在又一个页面index.html.erd,我想在底部把http://x.x.x.x/index.php页面中的内容添加进去,如何实现?
接触rails的时间只有半天,请解说的详细些,
谢谢!!!!
[b]问题补充:[/b]
Hooopo的第二次回答符合我的意思
但是controller中程序该怎么写啊 [code="Ruby"]
class HelloWorldController < ApplicationController
def demo
@html = open("http://www.google.cn/").read
end
end
[/code]
怎么出不来啊
在前面加:[code="ruby"]require 'open-uri'[/code]
iframe
controller:
[code="ruby"]def demo
@html = open("http://google.com").read
end[/code]
view:
[code="ruby"]
<%= @html %>
[/code]
楼主的意思是不是想用局部模板啊。
[code="ruby"]
require 'open-uri'
class HelloWorldController < ApplicationController
def demo
@html = open("http://www.google.cn/").read
end
end
[/code]
view:
[code="ruby"]#demo.html.erb
<%= @html %>[/code]
[code="Ruby"]ruby script/generate controller HelloWorld[/code]