Paginate by Year

I did this recently to paginate by month. Wasn't too hard as I recall. Just put the year into the route

/:controller/:action/:year

Or something similar. Then you can do: Day.find_by_year(params[:year])
Then just create links to each year, or what I did is something like
<%= link_to :action => thesameaction, :year => params[:year] + 1 %>
I didn't do the plus 1 thing, I did next_month or something. But it's doable.

Sam Woodard wrote:

You have to edit config/routes.rb.
Read the section on routing in AWDWR. This is one of the sections that made me go "wow".
You need to know it if you're going to develop in Rails.

Sam Woodard wrote: