Permalink
Browse files

Check for blankness of params[:date] before we try to parse it

  • Loading branch information...
1 parent 0933011 commit a76ab6a0436a983bd0cd29cff4d0376a201476af @aditya aditya committed May 7, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/controllers/phrases_controller.rb
@@ -7,7 +7,7 @@ def index
# 30 day range centered on the current date
@range = 30
- @range_center = params[:date] ? Date.parse(params[:date]) : Date.today
+ @range_center = !params[:date].blank? ? Date.parse(params[:date]) : Date.today
@range_start = @range_center - (@range / 2)
@range_end = @range_center + (@range / 2)

0 comments on commit a76ab6a

Please sign in to comment.