added form fields validation, and added content_tag to flash error message