Fixed issue with authenticity token by removing when clause from protect_from_forgery