map.connect 'posts/bydate/:year/:month/:day', :controller => 'posts', :action => 'show_date', :requirements => { :year => /(19|20)\d\d/, :month => /[01]?\d/, :day => /[0-3]?\d/ }, :month => nil, :day => nil def show_date @posts = Post.find(:all) @posts = @posts.select {|x| x.created_at.year == params[:year].to_i} @posts = @posts.select {|x| x.created_at.month == params[:month].to_i} if params[:month] @posts = @posts.select {|x| x.created_at.day == params[:day].to_i} if params[:day] render(:action => :index) end