Skip to main content

Basic CMS: Allow users to add custom CSS

Rails • Asked by Logan Houston

For an App I am building, the platform provides users with a unique subdomain, which they can customize the layout by adding Rows, which have various templates to choose from. I want to allow users to upload their own CSS / JS to customize the look of the page.

Right now I am allowing them to upload a file to the platform, and then I render the file in page if present. I am wondering if there is a better approach to this.

Thanks for your help.

Copy/paste into a text field which you can easily sanitise is probably a bit saver (for you and your users). Otherwise limiting users to change only certain aspects of the UI (colours, etc.) is often good enough. I've personally done almost full-custom layouts and the customer support for it was horrendous (“your pages are broken!”).

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.