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

  • SEARCH
  • Home
  • 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 8301133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:49:34+00:00 2026-06-08T16:49:34+00:00

I had an app based on Rails 3.0. This is a prediction app and

  • 0

I had an app based on Rails 3.0. This is a prediction app and I need different CSS rule sets on different spreads, because I use same selectors with different rules.

Previously in rails 3.0 I had a nice solution.

  1. I had a column in my database at my spreads with the name of the CSS file (without extension).

  2. I picked up this data like this:

    @spread = Spread.find_by_id(params[:spread_id])
    @css_to_use = @spread.css_to_use
    
  3. Put a conditional line in my application.html.erb:

    <%= stylesheet_link_tag @css_to_use unless @css_to_use.blank? %>
    

This worked well, untill now. I’m working this app out for Rails 3.2 and because of the asset pipeline, this magic is gone.

I found this:
Using Rails 3.1 assets pipeline to conditionally use certain css, but this is a bit sluggish solution (and now exactly what I want).

Is out there a nice work around for this problem? Do you know a solution that makes not only to load specified files but with a dependency?

  • 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-06-08T16:49:40+00:00Added an answer on June 8, 2026 at 4:49 pm

    i have a project with similar requirements and i use the techniques shown in the linked answer:

    # app/views/layouts/application.html.haml
    = stylesheet_link_tag "application", "labels/#{Whitelabel[:label_id]}"
    
    # config/application.rb
    # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
    config.assets.precompile += %w( active_admin.js active_admin.css labels/* )
    

    this includes an additional stylesheet, that is not included in the application.rb

    have a look at the full source: https://github.com/phoet/on_ruby/

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

Sidebar

Related Questions

I had this app using 1.9.2 and rails 3.2 and today I changed the
I had a Spring based java app that connected to PayPal using their Soap
I've had a ClickOnce app in use for a few months now, but recently
I had a rails 3 app on Nginx/Passenger that I just moved to Nginx/Thin
Has anyone had any experuience using web-based PVCS (Serena) source control app for Visual
So I had an app running Phonegap 1.4.0 (don't ask), I decided to upgrade
I recently had my app certified (first time!) but not automatically published. The game
I just had my app crash and now after alot of work its back
Me and My friend had an app idea. I have been working on the
I had integrated in app billing within my project in order to sell managed

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.