Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:56:54+00:00 2026-05-27T18:56:54+00:00

I have a setup where I have an engine (non-namespaced) for each subdomain .

  • 0

I have a setup where I have an engine (non-namespaced) for each subdomain. This works great because each subdomain is able to specify their own custom routes, controllers, views, and models. But I haven’t been able to figure out how to get assets to do what I want them to. Ideally javascript and stylesheets are only loaded for a particular subdomain if that subdomain is visited. I don’t want one stylesheet definition overwriting another in a different community.

Furthermore, I’d like images to be accessible as normal when using image_tag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:56:55+00:00Added an answer on May 27, 2026 at 6:56 pm

    I’ve figured out a solution. The JS, CSS, and images should all be stored in the default location of the engine, e.g. app/assets/javascripts/<subdomain>/application.js. Then, in the main app’s application.html.erb JS and CSS should be included like so:

    <%= stylesheet_link_tag "#{community.subdomain}/application" %>
    <%= javascript_include_tag "#{community.subdomain}/application" %>
    

    As for images, as long as they’re in app/assets/images/<subdomain>/ of the engine, they’ll show up in public as /assets/images/<subdomain>/my_image.png. Again, I’m using Rails 3.1; I’m not sure how this behavior is for other versions of Rails, including 3.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup my windows in a certain way. How do I save this
I have the following jsfiddle setup: http://jsfiddle.net/eyTBZ/2/ Basically almost everything works, apart from when
i was wondering if this setup would work. i have to crank out a
We have a custom setup engine (written in C#) that needs to continue the
I have been using wsgi on app engine to great success and now i
I'm a newbie to python and the app engine. I have this code that
I have to setup a blog engine that has to be integrated with a
I have setup web dav on windows server 2008. It seems to work fine
I have setup a property and implement INotifyPropertyChanged like so... public event PropertyChangedEventHandler PropertyChanged;
I have setup svnserve and for now now I am testing a repository with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.