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 6913661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:14:48+00:00 2026-05-27T09:14:48+00:00

I have a stylesheet, application.css defined in layouts/application.html.erb : <%= stylesheet_link_tag application %> However,

  • 0

I have a stylesheet, application.css defined in layouts/application.html.erb:

<%= stylesheet_link_tag "application" %>

However, there’s a section of the site where the views will use a completely different stylesheet, dashboard.css which I’ve defined in its index.html.erb:

<head>
    <title>My title</title>
    <%= stylesheet_link_tag "dashboard" %>
..

Unless I remove the stylesheet_link_tag in the application layout file, there are conflicts which make the dashboard view weird. If I move the application layout stylesheet tag to a _header.html.erb partial which is rendered with every view in the non-dashboard section like below, it doesn’t work. How must I call them?

<%= stylesheet_link_tag "application" %>
<header>
     <div id="headercontainer">
..
  • 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-27T09:14:48+00:00Added an answer on May 27, 2026 at 9:14 am

    Create a separate layout for your dashboard, with specific stylesheets.

    If you want customized stylesheet for one of your controllers (and all of its actions), it’s quite easy to do. Create a layout with matching name, that is, for your users_controller, template name should be users.html.erb.

    Also you can specify any layout for controller.

    class UsersController < ApplicationController
      layout 'some_layout'
    end
    

    If you want custom stylesheet only for some actions, specify corresponding layout in call to render.

    def dashboard
      # some logic here
      render :layout => 'some_layout'
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CSS stylesheet defined in the Master Page of my project. On
I have created a CSS stylesheet for my project. Is there any way I
i have just deployed my rails application but the css stylesheet wont appear I'm
I am creating a custom CSS stylesheet for a Rails 3 application. Is there
I have in <link href=/assets/application.css media=screen rel=stylesheet type=text/css /> <script src=/assets/application.js type=text/javascript></script> but when
There is nothing in application.css. I have put a file named cake.generic.css in app/assets
I have the following code in my application.erb file in my layouts directory. I
How can I get superscript done, only in CSS? I have a stylesheet where
In a stylesheet i have: * HTML BODY { padding-right: 0px; padding-left: 0px; padding-bottom:
I have an external stylesheet that has specific IE-hacks. Every so often my site

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.