0

I have:

<&= stylesheet_link_tag    "application", :media => "all" %>

but I am adding a (completely) alternative layout for some of the views in my application, with separate stylesheets. I would like to link the existing layout to only some of the stylesheets, and add others. What do I need to change here?

Lucy Weatherford
  • 5,232
  • 15
  • 49
  • 76

4 Answers4

1

for this you can create new file in views/layout as similar to your application.html.erb for example i am creating home.html.erb.Link your all stylesheets and js files in that and finally just add that layout name in your required controller as layout 'home'

shrikant1712
  • 4,066
  • 22
  • 39
0

You can use separate manifest file and include those manifest file This answer will help you how to do this

Community
  • 1
  • 1
Amar
  • 6,786
  • 4
  • 24
  • 23
  • I currently have a controller render a different layout file, and I'm trying to have a separate layout. Is that possible as well? – Lucy Weatherford Apr 15 '13 at 11:17
  • Yes,it is you can in your layout suppose it's sigin lay out you can use signin manifest – Amar Apr 15 '13 at 11:35
0

It specifies that your application.css should be loaded when the page is viewed in all media types. It's a CSS property, not a Rails property.

See http://www.w3.org/TR/CSS2/media.html#media-sheets for more details.

sevenseacat
  • 24,021
  • 5
  • 64
  • 85
0

You can add a separate layout for whole controller or for specific actions

For example:

in your controller:

layout :resolve_layout
 #controller code
 ...
def resolve_layout
    case action_name
    when "new", "create", "wait_conformation"
      "customer_layout"    
    else
      "producer_layout"
    end
end

Here customer_layout & producer_layout are layout files.

Raghuveer
  • 2,601
  • 3
  • 30
  • 57