Created
October 24, 2009 11:59
-
-
Save rociiu/217495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def custom_link_to(post) | |
"<a href='/blog/#{post.datetime.year}/#{post.datetime.month}/#{post.datetime.day}/#{post.slug}'>post.title</a>" | |
end | |
#routes | |
"/blog/:year", :controller => 'posts', :action => 'posts_for_year' | |
#controller actions | |
def posts_for_year | |
@posts = Post.find_by_year(params[:year]) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment