1

I'm working on application 'A' that's already built but foundation is not used. Now I need to work on another module 'B' that's within the same application 'A' but with foundation.

I have added gems 'compass-rails' & 'foundation-rails' in Gemfile and then run 'bundle install' & 'rails g foundation:install'.

Problem:

  • When I include "*= require foundation_and_overrides" in application.scss then it affects the entire application 'A'.

What is required:

  • I need to add "*= require foundation_and_overrides" only for module 'B' views so that the entire application won't get affected.

Queries:

  • Is there any possibility that we can use two different application.scss for rails application? Like I want to use A.scss (for application wide doesn't include foundation) and B.scss (only for module B with foundation).

Please help me out how I should cater this particular scenario.

Thanks in advance.

1 Answers1

0

The application.css is included by the layout (usually /views/layout/application.html.erb) with the instruction

<%= javascript_include_tag "application" %>

You should create a new application.scss with the fundation CSSs, and either:

  • create new layout which calls the new application.scss, et choose per controller which layout to use (as shown here)

  • using the same layout, add instructions to choose which application.css to include (as shown here)

Community
  • 1
  • 1
Baldrick
  • 23,882
  • 6
  • 74
  • 79