All corals are Cnidaria, meaning that all corals are quite related to jellyfish and anemones. Hard or stony corals are Hexacorallia, which also includes anemones and zoas. Whereas what most of us consider soft corals are Octocorallia, but some corals we consider softies are actually Hexacorallia (our hobby terms are based on physical appearance and care, not actual genetic relations. The term coral is actually a bit up in the air because.... well there isn't a single taxonomic classification that includes ONLY and ALL of what we consider corals. You see... all corals are Cnidaria, but this includes anemones and jellyfish too. Anthozoa is a more specific classification under Cnidaria that contains both Hexacorallia and Octocorallia, which is essentially contains almost all of the corals in our hobby, but sea anemones are also both Anthozoans and within Hexacorallia. There is also another Class under the phyumn Cnidaria which contains some "corals", this is Hydrozoa, and contains Milleporina (most don't consider these true corals but still they have the name fire coral.... if you want to say those under the Class Hydrozoa are not corals, then it makes it simpler... we could say all true corals are under the Class Anthozoa... but we may or may not consider everything in Anthozoa a coral. I don't think most people really call Zoanthids corals within the scientific community, however it is misleading to say that Zoanthids are more related to jellyfish than corals, in fact they are more related to corals than to jellyfish... in fact they are essentially about as related to jellyfish as corals are to jellyfish as well.
Also, Zoanthids also happen to be more related to hard corals than soft corals are to hard corals. In fact, anemones are more related to hard corals than soft corals are to hard corals. Its not JUST the genetic or taxonomic relation that determines what is a coral and isn't a coral. I know that must make it even more confusing.