The present disclosure is directed to compounds of formula (I) and pharmaceutically acceptable salts thereof, wherein ring A, ring B, L, R1, R2, R3, R4, R5, Ra, Rb, n, m, p and q are as defined herein, which are active as modulators of retinoid-related orphan receptor gamma t (ROR?t). These compounds prevent, inhibit, or suppress the action of ROR?t and are therefore useful in the treatment of ROR?t mediated diseases, disorders, syndromes or conditions such as, e.g., pain, inflammation, COPD, asthma, rheumatoid arthritis, colitis, multiple sclerosis, psoriasis, neurodegenerative diseases and cancer.