[BUG]学校页面存在异常
Reported by yuanyi | 2009-09-04 09:52:45 UTC | in BUG
http://dev.1kg.org/schools/2868
异常信息:
Extracted source (around line #155):
152:
153:
154: <% if @need -%>
155: <%if @need.urgency.length > 0 -%>
紧急需求:<%= h @need.urgency %>
<% end -%>156: <%if @need.book.length > 0 -%>
图书:<%= h @need.book %>
<% end -%>157: <%if @need.stationary.length > 0 -%>
文具:<%= h @need.stationary %>
<% end -%>158: <%if @need.sport.length > 0 -%>
文体用品:<%= h @need.sport %>
<% end -%>Comments and changes to this ticket
-

makestory 2009-09-04 10:31:30 UTC
这是我改后出现的问题
原因好像是学校需求字段有的是nil有的是空字符串。
我昨天刚好碰到字符串了 用 xxxx.length > 0 来判断了我觉得应该在model层控制一下字段, 统一没有内容的 都是nil
-

-

makestory 2009-09-04 12:43:39 UTC
我把<%if @need.xxxx.length > 0 -%> 改成 <%if @need.xxxx -%> 了
但是还没有解决 http://1kg.lighthouseapp.com/projects/35907/tickets/39 这个ticket
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
