beast学习笔记——7,forums/index.html.erb——结束篇
beast学习笔记——7,forums/index.html.erb——结束篇
1
(1)代码
<% content_for :right do %>
......
<% end %>
(2)表示
已在上一节解释过了。
2
(1)代码
number_with_delimiter(current_site.topics.size)
(2)表示
number_with_delimiter,view的辅助方法,用于格式化数字,例如:
<%=number_with_delimiter(12345678)%>
=>12,345,678
3
(1)代码
<% if recent_forum_activity(forum) %>
(2)表示
recent_forum_activity,来自helper方法,在文件forums_helper.rb中
========分割线==========
当我学习beast到此时,在Ruby On Rails的QQqun有人指点,可以看“Ruby on Rails Tutorial”来学习(http://railstutorial.org/chapters/beginning#top),起码,它是测试驱动开发的实例。
所以,打算终止Beast源码的学习,开始新的学习旅程。