The opinion of the court was delivered by
Valentine, J.:This case is badly mixed. Just what kind of action or actions the plaintiff intended to bring, we can hardly tell. But even if that problem were satisfactorily solved, still the case would not then be relieved from all difficulty. There are some inherent complications and intricacies equally difficult, of solution. The petition below i& drawn up in form as though it was intended to state only one cause of action; and yet the petition asks for several different kinds of relief, and such as are usually granted only in different kinds of action. It in substance asks that the plaintiff shall recover the undivided-half of certain real property of which he is not now in possession; that a certain tax deed on said real property be set aside and held for naught; that a certain supposed cloud upon the plaintiff’s title be removed;. that certain rents and profits received by the several defendants for the use of said property be accounted for by each of *401the defendants, respectively; that the said real property be partitioned, and one-half thereof given to the plaintiff in . severalty, “and that each of the defendants, their heirs and assigns, be barred from setting up any claim to, interest or estate in, or title to, or lien upon the same.” Now whatever this action or any part thereof may be called, still it is all • brought or intended to be brought under the code of civil procedure; and therefore under such code we suppose that “the court, in every stage of- action, must disregard any error or defect in the pleadings or proceedings which does not affect the substantial rights of the adverse party; and no judgment shall be reversed or affected by reason of such error or defect:” (Gen. Stat; 655, §140.) “And all proceedings under it, (said code,) shall be liberally construed, with a view to promote its object, and to assist the parties in obtaining justice.” (Gen. Stat. 631.) Said petition was not attacked in the court below in any manner except by demurrer. No motion was made to require that it be made more definite and certain; or that the several causes of action therein stated, be separately stated and numbered; or that any portion thereof be stricken out for immateriality, irrelevancy, or redundancy; and indeed, no motion was made attacking the petition in any manner whatever. The demurrer attacked the petition on the grounds, first, that several causes of action were improperly joined; second, that the petition did not state facts sufficient to constitute a cause of action. This demurrer was overruled by the court below, and this is one of the rulings now complained of by the defendants below, who are plaintiffs in error in this court. Whether the court below erred or not, in this ruling, is the principal question involved in this case, and we may as well consider the question now, and before passing to the other questions.
*402statement of pleadings. *401I. The principal question involved in this case is, whether there were in fact several causes of action improperly joined. If no cause of action was in fact stated in the petition, as the defendants below claim by the second ground of their demurrer, then of course several causes of action were not improp*402erly joined. But supposing that there was a cause of action stated in the petition, and more than one: then were there several causes of action improperly joined ? The question is not, whether the several causes of action actually stated in the petition were stated therein in an improper manner; for such a question cannot be raised on demurrer. But the real question is, whether the several causes of action actually stated in the petition can all be joined or united in one action. The petition in substance and effect, though not in these words, states we think about as follows: First, The plaintiff below, Albert G. Smith, is the owner and entitled to the immediate possession of the undivided-half of the west 55 feet of lots 8 and 9, in block 12, of the city of Atchison; but he is not in the possession thereof, and has not been in the possession thereof for several years; nor has he received any of the rents or profits thereof for several years. Second, George Scarborough, one of the defendants below, is the owner of the other undivided-half of said real property, (he having received his title thereto, by a deed for said undivided-half of said property from Thomas A. and Wm. L. Irvine, who were formerly tenants in common with the plaintiff. Scarborough was formerly in possession of said property, and received the entire rents and profits therefrom for several years, and has refused and still refuses to account to the plaintiff therefor, or for any part or portion thereof. But whether Scarborough is still in the possession of said real property, or of any part or portion thereof, is not very clear. If he is not in possession of any part or portion thereof, then Auld and Stebbins, the other defendants, are in the actual possession of the whole of it. Third, Auld and Stebbins are in the possession of at least an undivided-half of said property, and unless Scarborough is in possession of the other half they are in the actual possession of the whole of it; and they have been receiving the rents and profits thereof for several years, but they refuse to account to the plaintiff for any part or portion thereof. They hold said property under a quitclaim deed *403from Wm. L. Irvine to themselves, and a tax deed from the county clerk of Atchison county to Wm. L. Irvine. Said quitclaim deed was executed subsequently, and said tax deed prior, to the execution of said deed for the undivided-half of said property from Thomas A. and Wm. L. Irvine to Scarborough. Said tax deed is void on its face, for reasons stated in the petition. Thomas A. and Wm. L. Irvine, the plaintiff’s former co-tenants, are not parties to this action, but it would seem from the petition that even' they had, long prior to their transferring any interest to Scarborough, ousted the plaintiff from the said premises, and thereafter received all the rents and profits therefrom, and have ever since refused to account to the plaintiff for any part or portion thereof, and Wm. L. Irvine (one of the plaintiff’s co-tenants) took a tax deed to himself for the whole of said premises. The plaintiff closes his petition by asking for the relief heretofore stated.
_. . , inetuie^rents and profits. We suppose the plaintiff sets forth in his petition three causes of action: first, an action in the nature of ejectment, under section 595 of the civil code, for the recovery of his undivided-half interest in said real property; second, an action to recover the value of his portion of the rents and profits of said real property; (see Gen. Stat. p. 541, §22, p.646, §83, sub. 6;) and third, and an action for partition of said real property; (see Gen. Stat. 753 to 755, §§614 to 629.) We do not think that the plaintiff sets forth a cause of action to quiet title or possess|ou^ or remove a cloud therefrom, for he does not show that he is in the possession of the property either actually or constructively — a necessary element in that kind of actions; but he does show that others are in the actual possession of the property, denying his right and title to the property, and enjoying the proceeds thereof. By the plaintiff’s action of ejectment however, he can virtually quiet his title and possession, and remove said .supposed cloud from his title, and have said tax deed declared void, provided that he recovers in the action; for such an action, where the plaintiff *404recovers, settles all questions between the plaintiff and defendant with respect to the property. The said causes of action for ejectment and for partition may virtually and in fact be only one cause of action. The plaintiff has a right in law to possess and enjoy some specific portion of said real property, and the defendants deprive him of this right. This would seem to constitute the elements of only one cause of action; and yet this includes both the causes of action, for ejectment, and for partition. That both of these causes of action in fact constitute only one enlarged cause of action, may be the view that the supreme court of Ohio took in the case of Tabler v. Wiseman, 2 Ohio St. 208, 211. In that case the court decided that, “In Ohio, a right of entry will entitle a party to the proceeding in partition, without the actual seisin required in some other states. If the tenant is not prevented by some intervening estate, from recovering the possession by an action at law, he will not be disabled to prosecute his writ of partition.” Now if the two causes of action for ejectment and partition, when united, constitute only one enlarged cause of action, then it is entirely unnecessary to inquire in this case what causes of action may be united, or to inquire whether the cause of action for rents and profits may be united with this enlarged cause of action; for on the final determination of this action, in the court below, nothing was allowed the plaintiff for rents and profits. We shall however suppose, for the purposes of this action, that the two causes of action, for ejectment, and for partition, are two separate causes of action. Then can these two causes of action be united in one action? And can they both be united with another cause of action for rents and profits taken from the same real property? That the cause of action for ejectment, and that for rents and profits, may be united in the same action, there can be no question. Section 83 of the code provides, that —
“The plaintiff may unite several causes of action in the same petition, whether they be such as have heretofore been denominated legal, or equitable, or both, where they all arise *405out of either one of the following classes: * * * Sixth, Claims to recover real property, with or without damages for the withholding thereof, and the rents and profits of the same.” (Gen. Stat. 645, 646.)
The question however still remains, as to whether the cause of action for partition may be united with the other two causes of action. This depends upon another provision of said section 83 of the code. Said section provides, that—
“The plaintiff may unite several causes of action in the same petition, whether they be such as have heretofore been denominated legal, or equitable, or both, where they all 'arise out of either one of the following classes: First, The same transaction, or transactions connected with the same subject of action.”
, actions. *406, , phmesdefined, *405Now whether these three causes of action may all be united in one action, or rather whether the cause of action for partition may be united with the other two causes of action, depends upon the meaning of the words, “causes of action,” “arise out of,” “transactions,” “connected with,” and “subiect of action.” We shall not attempt to define these, words any further than is necessary to apply them to this case. Now in this case we have three causes of action: First, for ejectment — the elements of which are as follows: the plaintiff has a right to the possession and enjoyment of said real property in common with his co-tenant or co-tenants — he one-half, and his co-tenant or co-tenants the other half — but the defendants deprive him of that right. Second, for rents and profits — the elements of which are as follows: the plaintiff has a right to the use and enjoyment of one-half of the rents and profits of said real property, but the defendants deprive him of that right. Third, for partition — the elements of which are as follows: the plaintiff has a right to the use and enjoyment, if he prefers it, to some specific moiety of said real property, the same to be set off to him in severalty, but the defendants deny and resist such right. These three causes of action are in fact all founded upon, or, in other words, “arise out of,” three classes of infringements upon one single right of the plaintiff. These *406infringements are the “ transactions ” out of which the plaintiff’s several causes of action arise, and are just such “transactions” as are contemplated in said section 83 of the code; and they consist merely of the acts of the defendants in contravention of the said right of the plaintiff. The word “transactions,” as used in said section, probably means, whatever may be done by one person which affects another’s rights, and out of which a cause of action may arise. Said single right of the plaintiff in this action, consists in his right to use and enjoy, in the manner he chooses, his said interest in said real property, with all the proceeds and avails thereof. This right is the “subject of action” in this case. It is the basis and foundation of the whole action. Each of the several causes of action depends entirely for its support upon the soundness and validity of this right; and, unless such right can be maintained, this whole action must fail. The phrase, “subject of action,” would probably ordinarily have a broader signification than we have given it. It would probably ordinarily mean, as to each cause of action, the entire “subject-matter of the action.” But for the purposes of uniting various causes of action it cannot have a broader signification than we have given it. , Of course, it does not include the several “transactions” “connected with” it, and out of which the several causes of action arise; for the “subject of action” (the “same” subject of action) must be common to all the several causes of action which are united, while the several “transactions” cannot be thus common. Each transaction or class of transactions must ordinarily belong to a different cause of action. And of course, the “subject of action” is not the “cause of action,” or the cause of any action, or any cause of action. It is simply one of the elements of each of the several causes of action, uniting and binding them together in one action. The legislature did not commit the folly of enacting, that several “causes of action” may be united when they all arise out of transactions connected with the same “cause of action.” But they enacted, *407that several “causes of action” may be united when they all arise out of transactions connected with the same “subject of action.” Neither can the “subject of action” be the “object of the action.” The “subject of action” must exist prior to the creation of the causes of action which, are to be united; for the causes of action are such as “arise out of” transactions “connected with” the “subject of action.” But the “object of the action” is only brought into existence by the commencement of the action itself, long after both the “subject,of action” and the “causes of action” have had an existence. The “object of the action” is the thing sought to be attained by the action. It is the remedy demanded, the relief prayed for, and is no part of the “subject of action,” or the “cause of action.” The “subject of action,” then, not being the whole of the “subject-matter of the action,” nor the “cause of action,” nor the “object of the action,” we think it is just what we have heretofore stated it to be. It is in this case, the original right of the plaintiff to enjoy his said property as he pleases. Now this right being the “subject of action,” and the various infringements upon this right being the “transactions” out of which the plaintiff’s several “causes of action” arose, it is clear that all of said “ transactions ” are “ connected with the same subject of action;” and therefore, that all of the said several causes of action may be united in one action. This view of the law is also in accordance with the general policy of the code, which seems to be to have the whole subject-matter of any controversy settled in one action. (See Page v. Webster, 8 Mich. 273.) We would also refer to the following sections of the code as throwing some light upon the question now under consideration:
“ Sec. 36. Any person may be made a defendant, who has, or claims, an interest in the controversy adverse to the plaintiff, or who is a necessary party to a complete determination or settlement of the question involved therein.” .
“Sec. 41. The court may determine any controversy between parties before it, when it can be done without prejudice to the rights of others, or by saving their rights; but *408when a determination of the controversy cannot be had without the presence of others, the court must order them to be brought in.” •
“Sec. 616. .Creditors having a specific or general lien upon all or any portion of the property, [in an action for partition,] may be made parties.”
“Sec. 617. The answers' of the defendants [in an action for partition] must state, among other things, the amount and nature of their respective interests. They may also deny the interests of any of the plaintiffs, or any of the defendants.”
“Sec. 629. The court shall have full power [in an action for partition] to make any order, not inconsistent with the provisions of this article, [relating to partition,] that may be necessary to make a just and equitable partition between the parties, and to secure their respective interests.”
partition, posnecessary. II. Does the petition state facts sufficient to constitute a cause of action for partition? It may be said, that, admitting that all the several causes of action set forth in the plaintiff’s petition may be properly joined in one action, and that all the persons made parties to this action may properly be made parties thereto, still, can a plaintiff in partition, who is not in possession of the property sought to be divided, maintain the action? (This question does not properly arise here; but as it is in the case we shall consider it now.) Whether ‘such action can be maintained, we think depends upon whether the plaintiff is entitled to the immediate possession of the property, or not, and whether his petition shows that he is so entitled to such immediate possession. If the plaintiff is entitled to the immediate possession of the property, we think he may maintain the action. (Tabler v. Wiseman, 2 Ohio St. 208, 211.) If the property were not held adversely to the plaintiff, we would think that there could scarcely be any doubt as to the plaintiff’s right to maintain the action. But even where the property is held adversely to the plaintiff, we would still think that the plaintiff might maintain the action in connection with an action for the recovery of the property. And possibly both actions taken together, as heretofore suggested, are only one enlarged *409action, and that an action for partition. Our code of civil procedure authorizes the action for partition, but does not prescribe specifically who shall bring the action, or what kind of an estate or interest in the land the plaintiff shall have. It seems to leave the matter open for any person who has any interest in land in which others also have an interest, to commence the action. Up to 1868 the statute read, “that all joint tenants, tenants in common, and coparceners of any estate in lands, tenements, and hereditaments, within this state, may be compelled to make or suffer partition of such estate.” (Comp. Laws, 740, §1.) But in 1868 this provision was repealed, and in lieu thereof it was enacted, that “when the object of the action is to effect a partition of real property, the petition must describe the property, and the respective interests of the owners thereof, if known.” (Gen. Stat. 753, § 614.) Now the words, “real property,” as used in our statutes, “include lands, tenements, and hereditaments, and all rights theréto and interest therein, equitable as well as legal.” (Gen. Stat. 999, §1, sub. 8.) Under our statutes the action of partition is legal as well as equitable, and the action of ejectment is equitable as well as legal. (As to ejectment being an equitable as well as legal action in this state, see Simpson v. Boring, 16 Kas. 248, 251.) The same court has jurisdiction of both actions, and the.two actions may be united in the same proceeding, as we' have heretofore seen. Therefore, whatever may have been 'the reason at one time for refusing to partition land where the plaintiff was not in the possession thereof, no such reason now exists; and when the reason for any particular rule ceases, so does the rule itself cease. This disposes of the material question in the case, and it is unnecessary to consider any of the other questions suggested by counsel.
The judgment of the court below will be affirmed.
Brewer, J., concurring. Horton, C. J., not sitting in the case.