public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Fix problem with URLs on the moderate comments page.

The URLs to the Ajax actions were wrong because the article's ID wasn't 
present.  Instead of using @article (which is nil in this case), use the 
comment's article.
francois (author)
Tue Mar 04 10:37:54 -0800 2008
commit  96cdc957653159c24ebf59a5096bcde6554ba58f
tree    d9c59c8f7caeba2d4f0503e424f3763252b67878
parent  628cbde5cdced976670e81a55a71f8d25f123b2d
...
24
25
26
27
 
28
29
 
30
31
 
32
33
 
34
35
36
...
24
25
26
 
27
28
 
29
30
 
31
32
 
33
34
35
36
0
@@ -24,13 +24,13 @@
0
     <span class="meta">
0
       <cite>&mdash; <%= author_link_for comment %><%= %( (#{comment.author_email})) unless comment.author_email.blank? %> said <%= time_ago_in_words comment.created_at %> ago</cite>
0
     
0
- <%= link_to_remote 'Edit', :url => edit_article_comment_path(@article, comment), :method => :get %> |
0
+ <%= link_to_remote 'Edit', :url => edit_article_comment_path(comment.article, comment), :method => :get %> |
0
     <% if comment.approved? -%>
0
- <%= link_to_remote 'Unapprove', :url => unapprove_article_comment_path(@article, comment) %> |
0
+ <%= link_to_remote 'Unapprove', :url => unapprove_article_comment_path(comment.article, comment) %> |
0
     <% else -%>
0
- <%= link_to_remote 'Approve', :url => approve_article_comment_path(@article, comment) %> |
0
+ <%= link_to_remote 'Approve', :url => approve_article_comment_path(comment.article, comment) %> |
0
     <% end -%>
0
- <%= link_to_remote 'Delete', :url => article_comment_path(@article, comment), :method => :delete %>
0
+ <%= link_to_remote 'Delete', :url => article_comment_path(comment.article, comment), :method => :delete %>
0
     </span>
0
   </li>
0
   <% end -%>

Comments

  • TomK32 Wed Jun 11 10:13:30 -0700 2008

    actually it would be better if you user comment.article_id instead of comment.article. The first won’t load the article from the database, thus saves a lot of queries.

  • elliottcable Wed Jun 11 18:54:07 -0700 2008

    TomK: You can use markdown formatting here – that’s `\`code\`` d-:

  • elliottcable Wed Jun 11 18:54:18 -0700 2008

    Or perhaps I was wrong. Mah badzor.