[typo] Redirects

Justus Pendleton justus at ryoohki.net
Wed Sep 7 17:37:13 EDT 2005

Mike Purvis wrote:

[I'm a Ruby & Rails neophyte so if I'm wrong below I'm sure someone will 
correct me :) ]

> Firstly, it's not finding "find_by_name". I noticed the the view_page 
> action in the Article controller references "Page.find_by_name", but I 
> don't see a separate Page controller... are pages just handled as Articles?

There is no separate PageController but "Page.find_by_name" isn't being 
called on the controller, it is being called on the model, which is 
handled in app/models/page.rb

You'll probably want to call Article.find_by_permalink(year, month, day, 
title) which is in the model for articles app/models/article.rb.

> And the question: The article_url() function seems to be defined inside 
> Application.rb file, which just calls url_for. Is url_for a general 
> Rails url construction scheme that takes routing.rb rules into account, 
> or is a part of Typo that's defined somewhere I'm not seeing?

url_for is a rails thing.


More information about the Typo-list mailing list