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

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@52 189f022a-1064-8ae2-3e6f-c4a67275c50b

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">
......
......@@ -115262,3 +115262,182 @@ Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 201
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Redirected to http://www.touhou.cc/bbs/css/ui-lightness/jquery-ui-1.8.11.custom.css?
Completed 302 Found in 125ms
Started GET "/" for 127.0.0.1 at 2011-03-31 15:15:09 +0800
Processing by BoardsController#index as HTML
User Load (906.2ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
Rendered app/themes/lotus/layouts/_header.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_top.html.erb (15.6ms)
Rendered app/themes/lotus/layouts/_footer.html.erb (0.0ms)
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (93.8ms)
Completed 200 OK in 1453ms (Views: 171.9ms | ActiveRecord: 921.9ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:15:53 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
Rendered app/themes/lotus/layouts/_header.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_top.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_footer.html.erb (0.0ms)
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (15.6ms)
Completed 200 OK in 297ms (Views: 78.1ms | ActiveRecord: 31.2ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:15:57 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
Rendered app/themes/lotus/layouts/_header.html.erb (15.6ms)
Rendered app/themes/lotus/layouts/_top.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_footer.html.erb (0.0ms)
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (62.5ms)
Completed 200 OK in 281ms (Views: 109.4ms | ActiveRecord: 31.2ms)
Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 2011-03-31 15:15:57 +0800
Processing by ApplicationController#redirect_to_thc as HTML
Parameters: {"anything"=>"css/ui-lightness/jquery-ui-1.8.11.custom.css"}
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Redirected to http://www.touhou.cc/bbs/css/ui-lightness/jquery-ui-1.8.11.custom.css?
Completed 302 Found in 156ms
Started GET "/" for 127.0.0.1 at 2011-03-31 15:19:51 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (0.0ms)
Completed in 203ms
ActionView::Template::Error (undefined method `introduction' for nil:NilClass):
33: <%= @board %>
34: </div>
35: <div id=b2_2_d2_inf2>
36: <%= @board.introduction %>
37: </div>
38: <div id=b2_2_d2_inf3>
39: 涓婚锛3416 鍥炶锛356834 post
app/themes/lotus/boards/index.html.erb:36:in `_app_themes_lotus_boards_index_html_erb___538402209_14391672_889017846'
app/controllers/boards_controller.rb:10:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (62.5ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (93.8ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:29:59 +0800
Processing by BoardsController#index as HTML
User Load (31.2ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
SQL (15.6ms) SELECT COUNT(*) FROM `topics` WHERE (`topics`.`deleted` = 0) AND (`topics`.category_id = 1)
SQL (15.6ms) SELECT COUNT(*) FROM `posts` INNER JOIN `topics` ON `posts`.topic_id = `topics`.id WHERE ((`topics`.category_id = 1))
Rendered app/themes/lotus/layouts/_header.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_top.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_footer.html.erb (0.0ms)
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (390.6ms)
Completed 200 OK in 781ms (Views: 515.6ms | ActiveRecord: 78.1ms)
Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 2011-03-31 15:30:10 +0800
Started GET "/" for 127.0.0.1 at 2011-03-31 15:31:32 +0800
Processing by BoardsController#index as HTML
SQL (15.6ms) SHOW TABLES
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
DEPRECATION WARNING: RAILS_ROOT is deprecated. Please use ::Rails.root.to_s. (called from set_language at D:/zh99998/Reliz/app/controllers/application_controller.rb:28)
Board Load (15.6ms) SELECT `boards`.* FROM `boards`
SQL (15.6ms) SELECT COUNT(*) FROM `topics` WHERE (`topics`.`deleted` = 0) AND (`topics`.category_id = 1)
SQL (15.6ms) SELECT COUNT(*) FROM `posts` INNER JOIN `topics` ON `posts`.topic_id = `topics`.id WHERE ((`topics`.category_id = 1))
Rendered app/themes/lotus/layouts/_header.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_top.html.erb (0.0ms)
Rendered app/themes/lotus/layouts/_footer.html.erb (15.6ms)
Rendered app/themes/lotus/boards/index.html.erb within layouts/application (421.9ms)
Completed 200 OK in 1625ms (Views: 437.5ms | ActiveRecord: 78.1ms)
Started GET "/css/ui-lightness/jquery-ui-1.8.11.custom.css" for 127.0.0.1 at 2011-03-31 15:31:49 +0800
Processing by ApplicationController#redirect_to_thc as HTML
Parameters: {"anything"=>"css/ui-lightness/jquery-ui-1.8.11.custom.css"}
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Redirected to http://www.touhou.cc/bbs/css/ui-lightness/jquery-ui-1.8.11.custom.css?
Completed 302 Found in 109ms
Started GET "/" for 127.0.0.1 at 2011-03-31 15:37:08 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Completed in 172ms
NameError (undefined method `logo' for class `Board'):
app/models/board.rb:12:in `<class:Board>'
app/models/board.rb:1:in `<top (required)>'
app/controllers/boards_controller.rb:8:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (15.6ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (46.9ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:38:05 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Completed in 188ms
NameError (undefined method `logo_url' for class `Board'):
app/models/board.rb:12:in `<class:Board>'
app/models/board.rb:1:in `<top (required)>'
app/controllers/boards_controller.rb:8:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (15.6ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (31.2ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:39:25 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Completed in 125ms
NameError (undefined method `logo_url' for class `Board'):
app/models/board.rb:2:in `<class:Board>'
app/models/board.rb:1:in `<top (required)>'
app/controllers/boards_controller.rb:8:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (31.2ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:39:37 +0800
Processing by BoardsController#index as HTML
User Load (15.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Completed in 125ms
NameError (undefined method `logo' for class `Board'):
app/models/board.rb:2:in `<class:Board>'
app/models/board.rb:1:in `<top (required)>'
app/controllers/boards_controller.rb:8:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (15.6ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (15.6ms)
Started GET "/" for 127.0.0.1 at 2011-03-31 15:39:52 +0800
Processing by BoardsController#index as HTML
User Load (31.2ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 0) LIMIT 1
Completed in 188ms
NameError (undefined method `logo' for class `Board'):
app/models/board.rb:13:in `alias_method'
app/models/board.rb:13:in `<class:Board>'
app/models/board.rb:1:in `<top (required)>'
app/controllers/boards_controller.rb:8:in `index'
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (15.6ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered D:/zh99998/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (15.6ms)
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