[typo] revisiting recent articles sidebar (argh!)

Kyle Cooney kyle.cooney at gmail.com
Mon Aug 15 20:19:13 EDT 2005

Hey all -

I'm about to pull my hair out on this subject. I have the sidebar that 
Justus was kind enough to share on this list(and I've also tried making the 
adjustments Scott recommended). But I keep recieving Application 
Error(rails) messages. I checked my production.log file and have come up 
with the following error message:

ActiveRecord::StatementInvalid (You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right 
syntax to use near '== 1 ORDER BY created_at DESC LIMIT 5' at line 1: SELECT 
* FROM articles WHERE published == 1 ORDER BY created_at DESC LIMIT 5):

For the record, I'm using the recent_controller.rb configured as follows:

class Plugins::Sidebars::RecentController < Sidebars::Plugin
def self.display_name
"Recent Articles"

def self.description
"List of recent articles for this blog"

def self.default_config
{'count' => 5 }

def content
@recent = Article.find(:all, :limit => @sb_config['count'], :conditions => 
["published == 1"], :order => 'created_at DESC')

def configure

and the content.rhtml is configured as follows:

<% unless @recent.blank? -%>
<h5>Recent Articles</h5>
<ul id="recent">
<% for article in @recent -%>
<li><%= article_link article.title, article %> </li>
<% end -%>
<% end %>

I've tried various configurations of all of the above. I'm running in 
production mode, and I've been restarting ruby as well as lighttpd while 
testing each change. Not sure what's going on. I thouhgt it might be related 
to way I've built my site with only one article/post on each page, but I'm 
not sure how to test that since the even the Azure template is using some of 
my customizations.

Thanks for any help. You can probably get a better feel for how my pages are 
constructed by going to

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20050815/559b5cba/attachment.htm

More information about the Typo-list mailing list