# from Lennon Day-Reynolds
# on Friday 18 November 2005 03:08 pm:

>With that in mind, are there any other "deal-breaker" bugs or missing
>pieces of functionality that we absolutely have to fix before making
>the switch from the current static site over to the "cat herder"?

Not sure about a have-to-fix.  There's something odd going on in the 
articles/create page:  "Couldn't find Article without an ID".


=== app/views/articles/list.rhtml
==================================================================
--- app/views/articles/list.rhtml  (revision 438)
+++ app/views/articles/list.rhtml  (local)
@@ -8,10 +8,12 @@

 <% for article in @articles %>
   <tr>
-    <td><%= link_to article.member.name,
+    <td><%=
+            mem = article.member
+            link_to mem ? mem.name : '',
             :controller => 'members',
             :action => 'show',
-            :id => article.member.id
+            :id => mem ? mem.id : ''
         %></td>
     <td><%= link_to article.title, article.link %></td>
     <% if article.member == session[:member] %>


I've also somehow managed to get my Index#index to crash as well.  
Likely it's all related to this broken entry:

pdxruby_dev=# select * from articles;
 id | member_id | modified_at | title | content | link | content_hash
----+-----------+-------------+-------+---------+------+--------------
  1 |         0 |             | hi    |         |      |
(1 row)

hmm.  my member_id is 1, not 0...


Funny.  The second patch fixes what the first one broke in a slightly 
functional way?  I'd check this stuff in, but I'm betting you guys 
maybe don't want it in trunk :-)  So, I think the problem is back in 
articles, but here we're assuming quite a bit about how much we can 
trust the database.  Besides the obvious need to get some SPOT, is this 
a show-stopper?


=== app/views/index/_article.rhtml
==================================================================
--- app/views/index/_article.rhtml  (revision 438)
+++ app/views/index/_article.rhtml  (local)
@@ -5,10 +5,10 @@
   :action => 'show',
   :id => article.id %>)
 <br/>
-Posted at <%= article.modified_at.to_formatted_s("%A %b %d at %I:%M 
%p") %>
-by <%= link_to article.member.name,
+Posted at <%= article.modified_at ? 
article.modified_at.to_formatted_s("%A %b %d at %I:%M %p") : 'oops' %>
+by <%= link_to article.member ? article.member.name : 'ack',
     :controller => 'members',
     :action => 'show',
-    :id => article.member.id %>
+    :id => article.member ? article.member.id : nil%>
 </p>
 </li>


--Eric
-- 
"Ignorance more frequently begets confidence than does knowledge."
-- Charles Darwin
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------
_______________________________________________
PdxRuby-dev mailing list
[email protected]
http://lists.pdxruby.org/mailman/listinfo/pdxruby-dev

Reply via email to