下载了N久的<Agile web development with rails>英文版,今天开始看,记录下一些看的过程值的记录的东西...俺记忆力一般
1.几个命令:
A.创建一个应用 rails 应用名称,如rails demo
B.启动服务器,在应用目录下:ruby script/server
C.创建controller: ruby script/generate controller hello
2.几个函数:
在rhtml页面模板中使用的函数:
h()函数:告诉ROR对字符串不进行任何处理,显示特殊字符,如h(killme6115@sina.com)
link_to()函数: 处理超链接,当然,可以写成<a href="'>,但不利于应用的修改和移植,最好采用link_to()函数
如:link_to "hello!!",:action=>"hello" 其中hello就是action的名称
3.在ROR中,controller顾名思义就是控制器,类似servlet作为转发器,view下的.rhtml文件作为显示模版,module为Active Record