Rails 笔记之Rails and Request URLs
- Rails and Request URLs
say:对应的是controller.
hello:只是say controller 里的一个action。
流程如下:
对应的目录结构
2、view
.rhtml 后缀告诉 Rails,需要借助ERb 系统对文件的内容进行扩展??ERb 就是用于将 Ruby 代码嵌入模板文件的。 (也就类似jsp或php之类)
action 里的实例变量可以在.rhtml里直接使用。
链接页面可作用 link_to 把各action 进行关联起来,如:
<%=link_to "GoodBye!",:action=>"goodbay"%>
h()方法,把动态内容转换成html 里保证里的内容不会乱。




0 Comments:
发表评论
<< Home