Save 36% for Black Friday! Learn more

New Discussion

Notifications

You’re not receiving notifications from this thread.

Separate Asset Pipeline

1
Rails

Im building a webapp that has an admin panel... I separated this by creating a new folder in the controllers 'admin' and also on my views... This way I can have two completely different styles, one for FE and one for the BE... I wanted to use tinymce for creating posts so installed the gem but I can only see the JS and CSS files showing up on the FE, nothing get loaded when I'm on the admin side unless I specifically enter the script tags... How can I bring specific libraries from the application.js file into my admin area?

Short answer: by using <%= javascript_include_tag 'admin', 'data-turbolinks-track': 'reload' %> and some conditional on the application.html. So if you're in the admin controller do display one specific css/js set and a different one if not.

Join the discussion
Create an account Log in