Fix invalid markup.
Try to redirect back before sending the user to the root_url when authentication is required.
Use the 'error' class on flash[:alert].