ruby程序要怎么才能在http:localhost:3000页面上浏览出来?

Python046

ruby程序要怎么才能在http:localhost:3000页面上浏览出来?,第1张

puts "hello 是写在rb文件中的

eg

app/controllers/hello_controller.rb #画面的控制

class HelloController <ActionController

def index

@hello = "hello"

puts @hello # "hello"

end

end

app/views/hello/index.rhtml

<table border="1">

<tr>

<td><%=@hello%></td> #@hello 或者$hello 这种变量才能在页面中使用

</tr>

</table>

地址是:http://localhost:3000/hello/say

超文本标记语言或超文本链接标示语言(标准通用标记语言下的一个应用)HTML(HyperText Mark-up Language)是一种制作万维网页面的标准语言,是万维网浏览器使用的一种语言,它消除了不同计算机之间信息交流的障碍。

它是目前网络上应用最为广泛的语言,也是构成网页文档的主要语言。HTML文件是由HTML命令组成的描述性文本,HTML命令可以说明文字、图形、动画、声音、表格、链接等。HTML文件的结构包括头部(Head)、主体(Body)两大部分,其中头部描述浏览器所需的信息,而主体则包含所要说明的具体内容。

我晕 楼上的那个 iamXiaMi 完全是乱搞啊 <html>//网页开始

<head>//头文件开始

<base href="当前文档的url全称(基底网址)" target="空白(_B)/父(_P)/自身(_s)/顶部(_T)">

<basefont face="隶书" size="6" color="blue"> //设定基准的文字字体,字号和颜色

<title>设定显示在浏览器左上方的标题内容</title>

<isindex>//表明该文档是一个可用于检索的网关脚本,由服务器自动建立

<meta name="keywords" content="关键字" />

<meta name="description" content="网页说明" />

<meta http-equiv="refresh" content="刷新时间/单位秒" />

<meta http-equiv="refresh" content="跳转时间/单位秒URL=跳转地址" />

<Meta name="Copyright" Content="版权说明">//Copyright (版权)

<Meta name="Generator" Content="你所用的编辑器">//Generator (编辑器)

<Meta name="revisit-after" Content="">//revisit-after (重访)

<Meta name="build" Content="时间"> //Build(网站建站时间)

<Meta name="Reply-to" Content="邮箱地址">//Reply-to(联系人邮箱)

<meta http-equiv="Content-Type" content="text/html"charset="gb2312"/>

<meta http-equiv="page-enter" content="revealtrans(duration=3,transtion=20)"

<meta http-equiv="page-exit" content="revealtrans(duration=3,transtion=20)"//duration滤镜持续时间 transtion 滤镜类型,表示使用哪种特效,取值为0-23.0 矩形减小 1 矩形扩大 2 圆形缩小 3 圆形扩大 4 向上擦除 5 向下擦除 6 向左擦除7 向右擦除8 垂直百叶窗9 水平百叶窗10 横向棋盘式 11 纵向棋盘式 12 溶解 13 左右向中部收缩 14 中部向左右展开 15 上下向中部收缩

6 向左擦除7 向右擦除8 垂直百叶窗9 水平百叶窗10 横向棋盘式 16 中部向上下展开 17 阶梯状向左下展开 18 阶梯状向左上展开 19 阶梯状向右下展开 20 阶梯状向右上展开 21 随机水平线 22 随机垂直线 23 以上随机选择

<style>设定css层叠样式表的内容

<link>设定外部文件的连接

<script>设定页面中程序的脚本内容

</head>//头文件结束

<body bgcolor 等等标记 >// 主题开始

<bgcolor="颜色代码">设定页面背景颜色

<background ="图片url地址">设定页面背景图像

<text ="颜色代码">设定页面文字颜色

<bgproper-ties="fixed">设定页面背景图像为固定

<link ="颜色代码">设定页面默认的连接颜色

<vlink ="颜色代码">访问后的连接颜色

<alink ="颜色代码">鼠标正在单击时的连接颜色

<leftmargin ="值">设定页面左边距

<topmargin ="值">页面右边距

</body> // 主题结束

</html>//网页结束

http-equiv常用类型

Expires(期限) 说明 指定网页在缓存中的过期时间,一旦网页过期,必须到服务器上重新调阅。用法<Meta http-equiv="Expires" Content="Web,26 Feb 2009 08:21:57 GMT">content 必须是GTM的时间格式 直接输入数字 表示多少时间后过期

Pragma (cach 模式)禁止浏览器从本地机的缓存中调阅页面内容 用法 <Meta http-equiv="Pragma" Content="No-cach">这样设定 浏览者无法脱机浏览

Window-target (显示窗口设定)

<Meta http-equiv="Window-target" Content="_top">用来防止别人在框架里面调用你的页面 Content 选项 _blank _top _self _parent

// 文字标记

标题字 <h1></h1>...<h6></h6>

粗体<b>斜体<em> 删除线<s>下划线<u>上标<sup>下标<bup>大字号<big>小字号<small> 段落<p>段落对齐<p align="left"> 预格式化<pre> 居中 <center>水平线<hr>水平线属性<hr width="100" size="10" color="#000000" align="center"> 换行<br><kbd>提示信息 <var>变量标记 /!<address>作者信息 <blink>文字闪烁标记 <tt>文字打字!/ 文字标记 <font face ="value" size="value" color="value">文字</font>

<plaintext>显示html代码 <ruby>被标示的文字<rt>说明文字</rt></ruby>