All threads / Basic CMS: Allow users to add custom CSS

Ask A Question

Notifications

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

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.