竞赛列表。贴吧列表的非空判断

数据迁移报错问题修改
This commit is contained in:
z9hang 2014-07-14 09:18:31 +08:00
parent e1c7aaa220
commit 6b6fd2906f
3 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,4 @@
class FirstPage < ActiveRecord::Base
attr_accessible :description, :title, :web_title
attr_accessible :description, :title, :web_title,:page_type
end
l

View File

@ -2,11 +2,19 @@
<% contests.each do |contest|%>
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %></td>
<td colspan="2" valign="top" width="50" >
<% unless contest.author.nil? %>
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
<% end %>
</td>
<td>
<table width="100%" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: &nbsp;<%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
<td colspan="2" valign="top"><strong>
<% unless contest.author.nil? %>
<%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>:
<% end %>
&nbsp;<%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
</tr>
<tr>
<td width="500">

View File

@ -3,7 +3,11 @@
<% if forums.any? %>
<% forums.each do |forum| %>
<div class="forums-index">
<div class="forums-inex-avatar"><%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %></div>
<div class="forums-inex-avatar">
<% unless forum.creator.nil? %>
<%= link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator) %>
<% end %>
</div>
<div class="forums-index-content">
<p ><%= link_to h(forum.name), forum_path(forum) %></p>
<p ><%= forum.description%></p>