Ask A Question


You’re not receiving notifications from this thread.

Basic CMS: Allow users to add custom CSS

Logan Houston asked in Rails

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!”).

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 81,149+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.