[typo] How to limit index.html to only one article?
Seth Hall
seth at remor.com
Sat Jul 2 00:06:07 EDT 2005
It's in the index method in the articles_controller.rb file
def index
@pages = Paginator.new self, Article.count, 10, @params['page']
@articles = Article.find(:all, :conditions => 'published !=
0', :order => 'articles.created_at DESC', :limit => 10, :offset =>
@pages.current.offset)
end
Change both of the 10s to 1s and you should be done.
I'll add a ticket to get that abstracted out to a variable. Thanks
for pointing that out.
.Seth
On Jul 1, 2005, at 11:29 PM, Luke Tymowski wrote:
> Hello,
>
> I'm in the process of converting my photoblog to Typo.
> I want the front page to show only the most recent entry, not the 10
> (or X) most recent as it does now. How do I do that?
>
> I've gone through all the bits & pieces, but can't find anything.
> I've searched the Typo mailing archives, but I don't see that anyone
> asked this question before.
>
> thanks,
>
> Luke
>
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list
>
More information about the Typo-list
mailing list