Skip to content

Instantly share code, notes, and snippets.

@rafaelp
Created August 24, 2011 13:29
Show Gist options
  • Save rafaelp/1168061 to your computer and use it in GitHub Desktop.
Save rafaelp/1168061 to your computer and use it in GitHub Desktop.
def index
if !params[:year].blank? and !params[:month].blank? and !params[:day].blank?
@date = Date.parse("#{params[:year]}-#{params[:month]}-#{params[:day]}")
else
@date = Date.today
end
end
def index
begin
@date = Date.parse("#{params[:year]}-#{params[:month]}-#{params[:day]}")
rescue
@date = Date.today
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment