Commit 051882e1 authored by 神楽坂玲奈's avatar 神楽坂玲奈

parent 7d0915d7
class Board < ActiveRecord::Base
belongs_to :superboard, :foreign_key => :super_id, :class_name => "::Board"
has_many :subboards, :foreign_key => :super_id, :class_name => "::Board"#, :as => :boards
#why it doesn't work?
......@@ -9,6 +10,10 @@ class Board < ActiveRecord::Base
def to_s
"<a href=\"/boards/#{id}\">#{name}</a>".html_safe
end
alias_method :logo_url, :logo
def logo
"<a href=\"/boards/#{id}\"><img src=\"#{logo_url}\"/></a>".html_safe
end
#alias topics_with_deleted topics
#def topics
# topics_with_deleted.where({:deleted => false}).order('').order('name')
......
......@@ -18,6 +18,8 @@
</tr>
</table>
</div>
<% @boards.each do |board| %>
<div id=b2_2>
<table width="100%" height="93px" border="0" cellspacing="0" cellpadding="0">
<tr>
......@@ -30,41 +32,13 @@
<td width: "686px">
<div id=b2_2_d2>
<div id=b2_2_d2_inf1>
第一次測試版塊
</div>
<div id=b2_2_d2_inf2>
版塊介紹:
</div>
<div id=b2_2_d2_inf3>
主題:53416 回覆:4356834 post
</div>
</div>
</td>
<td width="283px">
<div id=b2_2_d3_1>
</div>
<div id=b2_2_d3_2>
</div>
</td>
</tr>
</table>
</div>
<div id=b2_3>
<table width="100%" height="93px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="171px">
<div id=b2_2_d1>
<div id=b2_2_d1_avatar>
</div>
</div>
</td>
<td width: "686px">
<div id=b2_2_d2>
<div id=b2_2_d2_inf1>
<%= board %>
</div>
<div id=b2_2_d2_inf2>
<%= board.introduction %>
</div>
<div id=b2_2_d2_inf3>
<%=t 'board.topic' %>: <%= board.topics.count %> <%=t 'board.post' %><%= board.posts.count %>
</div>
</div>
</td>
......@@ -77,6 +51,7 @@
</tr>
</table>
</div>
<% end %>
</div>
<div class="box ui-widget-content ui-corner-all ui-helper-clearfix">
<div id="fuzhu">
......
This diff is collapsed.
1812
\ No newline at end of file
2360
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment