
433 N.W.2d 693 (1988)
Thomas A. ALBERHASKY, Appellant,
v.
CITY OF IOWA CITY, Iowa; Iowa City, Iowa Human Rights Commission; and J. Elijah Brown, Hearing Officer, Appellees.
No. 87-1805.
Supreme Court of Iowa.
December 21, 1988.
William L. Meardon of Meardon, Sueppel, Downer & Hayes, Iowa City, for appellant.
David E. Brown of Hayek, Hayek, Hayek & Holland, Iowa City, for appellees.
Considered by McGIVERIN, C.J., and LARSON, SCHULTZ, LAVORATO, and SNELL, JJ.
LAVORATO, Justice.
Thomas Alberhasky, the plaintiff here, was a respondent before the Iowa City Human Rights Commission because he had refused to allow occupancy of his mobile home court to a person with more than two children. He now appeals the ruling of the district court that denied his petition for a writ of certiorari. The district court found that Alberhasky had made a premature constitutional challenge before the commission to a civil rights ordinance. Because we agree with the district court's ruling, we affirm.

I. Background Facts and Proceedings.

Richard Green, a prospective tenant, filed a complaint with the Iowa City Human *694 Rights Commission, charging that Alberhasky had violated section 18-32 of the Iowa City Human Rights ordinance on housing. The ordinance provides in pertinent part: "It shall be unlawful for any person to: ... (2) Discriminate against any other person because of presence or absence of dependents...."
Before a hearing could be held on the complaint, Alberhasky filed a motion to dismiss, alleging, among other things, that the "ordinance is vague, indefinite, and contains no proper guideline or standard by which to determine whether in fact discrimination has occurred based upon the complaint." He further alleged due process and equal protection violations under the fifth and fourteenth amendments to the United States Constitution. Alberhasky's constitutional challenges in the motion are aimed at both the facial characteristics of the ordinance and its application.
Before a hearing could be held on the merits, Alberhasky filed a petition for writ of certiorari in the district court. He joined as defendants the city of Iowa City; the city's Human Rights Commission; and J. Elijah Brown, the hearing officer who overruled Alberhasky's motion to dismiss.
Shortly thereafter, Judge William R. Eads ordered that a writ issue. See Iowa R.Civ.P. 309. Hearing on the petition was held before a different judge, L. Vern Robinson, who denied the petition and annulled the writ. See Iowa R.Civ.P. 316. This appeal followed. See Iowa R.Civ.P. 318.

II. Denial of Certiorari Relief.

On appeal Alberhasky contends the hearing officer's order was without jurisdiction because the ordinance as applied to him is unconstitutionally vague. Hence, he concludes the district court erred in denying the petition and annulling the writ. We disagree.
Iowa Rule of Civil Procedure 306 provides that "[a] writ of certiorari shall only be granted when specifically authorized by statute; or where an inferior tribunal, board or officer, exercising judicial functions, is alleged to have exceeded its, or his proper jurisdiction or otherwise acted illegally." In applying the rule, we have uniformly held that
where the law clothes an inferior tribunal with authority to reach a decision on the facts submitted to it, its decision is not illegal if the subject matter and the parties are within its jurisdiction and there is evidence to support it. Review of the facts is for the purpose of determining whether the tribunal's decision is supported by any competent evidence.
Staads v. Board of Trustees, 159 N.W.2d 485, 490 (Iowa 1968).
One of the grounds the commission overruled in Alberhasky's motion was that of personal jurisdiction. The district court agreed, and Alberhasky has not raised that issue here.
Turning to the question of subject matter jurisdiction, we note that the enabling legislation for local laws on housing discrimination is found in Iowa Code chapter 601A (1985). Section 601A.5(2) empowers the Iowa state civil rights commission to "receive, investigate, and finally determine the merits of complaints alleging unfair or discriminatory practices." Section 601A.8 defines unfair or discriminatory housing practices for state law purposes. Section 601A.19 allows local governments to enact laws to implement chapter 601A. More specifically, section 601A.19 provides that nothing in chapter 601A "shall be construed as indicating an intent to prohibit an agency of local government having as its purpose the investigation and resolution of violations of [chapter 601A] from developing procedures and remedies necessary to insure the protection of rights secured by the Iowa Civil Rights Act."
Pursuant to this enabling legislation, section 18-17(a) of the Iowa City ordinance empowers the city's Human Rights Commission to "receive, investigate, and finally determine the merits of complaints alleging unfair or discriminatory practices." Section 18-32(2) makes it unlawful for any person to discriminate against another person because of presence or absence of dependents. Section 18-32 sets up a procedure for hearing complaints, provides *695 for the type of relief the commission is empowered to give, and allows for judicial review of its decisions. Clearly, the commission had subject matter jurisdiction because the ordinance empowered it to hear and determine the kind of complaint filed against Alberhasky. See In re Guardianship of Matejski, 419 N.W.2d 576, 576 (Iowa 1988) (subject matter jurisdiction is tribunal's power to hear and determine cases of the general class to which a particular proceeding belongs). We note further that Alberhasky apparently does not here challenge the commission's authority to hear and decide this kind of case.
Because no hearing on the merits of the complaint was held, we have no facts to review. We agree with the district court's well-reasoned analysis on this point:
Alberhasky's request to have portions of the Iowa City Human Rights ordinance declared unconstitutional, or determine that he is not in violation of the ordinance because he has only refused Green admission because of the numbers of dependents and not the "presence of dependents," is premature. This court is being asked to decide what the Human Rights Commission may decide. That is, the Human Rights Commission may determine that Alberhasky has not violated the ... ordinance because he has not discriminated on the basis of "presence of dependents." Until a determination on the merits of the case has been made by the lower tribunal, the court cannot determine that the commission has acted illegally or without jurisdiction. Because a writ of certiorari can only be granted where an inferior tribunal has exceeded its jurisdiction or acted illegally, the petition in the instant case must be denied. It is indeed possible that the commission will find in favor of Alberhasky.
Simply put, Alberhasky is attempting to make the district court the fact-finder, whereas under the rule, the court can only act in an appellate capacity, and then only if the tribunal has acted illegally or without jurisdiction.
We think the district court's analysis is supported by the familiar principle that exhaustion of administrative remedies in administrative proceedings must generally precede judicial review. Tindal v. Norman, 427 N.W.2d 871, 872 (Iowa 1988). The exception is applied when the administrative remedy is inadequate or its pursuit would be fruitless. Matters v. City of Ames, 219 N.W.2d 718, 719 (Iowa 1974). One notable application of the exception has occurred in those cases in which the constitutionality of legislation has been questioned. See id. at 719-20. In Matters, id., we approved of the "emerging rule" described in Metcalf v. Swank:
[i]n administrative law cases generally there is some lingering confusion as to whether exhaustion will be required when the constitutionality of a statute is challenged on its face rather than as applied. However, the emerging rule would appear to be that since the administrative remedy cannot resolve a constitutional challenge, exhaustion will not be required unless the administrative action might make judicial determination of the constitutional question unnecessary.
444 F.2d 1353, 1355-56 (7th Cir.1971) (citations omitted). Although approving the rule, we held that the plaintiff was still faced with the exhaustion requirement because he had challenged the ordinance "as applied," not "on its face." Matters, 219 N.W.2d at 720.
In Shell Oil Co. v. Bair, we required exhaustion whether the constitutional challenge was to the ordinance "as applied" or "on its face," as long as the constitutional issue affected a matter pending before an agency. 417 N.W.2d 425, 429 (Iowa 1987). We gave several reasons for this requirement.
First, permitting the administrative process to run its course may eliminate the need for reaching potential constitutional claims. Second, even facial constitutional issues are more effectively presented for adjudication based upon a specific factual record. The place for that record to be developed is before the agency that is entrusted with the determination of the adjudicative facts. Finally, facial constitutional challenges will probably be coupled with *696 claims that the legislation is unconstitutional as applied to the litigant. Efficient and effective judicial administration is more likely to occur if the entire proceeding is first determined by the agency. Id. at 430; see also Tindal, 427 N.W.2d at 872-74.
Here, Alberhasky is making a constitutional challenge to the ordinance "as applied." In his brief he states that he "sought a writ of certiorari on a number of grounds including a matter of jurisdiction because the ordinance as applied to [his] situation is unconstitutionally vague."
Accordingly, as the district court correctly decided, the matter should be heard and determined by the commission. It may be that the commission will find that Alberhasky has not violated the ordinance, in which event the constitutional issues will not have to be reached. If the commission's decision is adverse to Alberhasky, at least an adequate factual record will be available on judicial review in the event Alberhasky appeals.

III. Disposition.

The commission was legally empowered to hear and reach a decision on the merits of the complaint filed against Alberhasky. It had personal jurisdiction over Alberhasky as well as jurisdiction over the case. Notwithstanding the commission's lack of authority to hear the constitutional issues raised by Alberhasky, the district court correctly determined that a hearing on, and a determination of, the matter should precede any judicial review. Consequently, the district court did not err when it denied Alberhasky's petition for a writ of certiorari and annulled the writ issued earlier. Accordingly, the district court's decision should be affirmed.
AFFIRMED.
