I have a controller with multiple actions that take :year and :month as
attributes from the URL. I have made a private method check_date to
check the date is valid and check
redirect_to just tells rails what to render when it finishes. Rails will get confused if you add other render or redirect_to directives after the one you really want, so just return from the controller after the redirect_to - it's the 'normal' rails way to do things.