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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:07:40+00:00 2026-06-13T09:07:40+00:00

I generate a pdf and have to include css in the generated file so

  • 0

I generate a pdf and have to include css in the generated file so that the styling is correct in the pdf. To do this I have

<%= File.read(Rails.root.join("app", "assets", "stylesheets", "application.css.scss")) %>
<%= File.read(Rails.root.join("app", "assets", "stylesheets", "app.css.scss")) %>

But the sass isn’t templated correctly. Does anyone know what the correct code to render the files right are?

  • 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-13T09:07:42+00:00Added an answer on June 13, 2026 at 9:07 am

    replace File.read with

    YourApp::Application.assets["application.css.scss"].to_s.html_safe
    

    where YourApp is the name of the application you are working on. This will cause rails to render the scss inline.

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

Sidebar

Related Questions

I have a website that generates pdf file from CSP. Will this pdf file
I have a project where I need to generate a PDF file. Within this
I have small web app that generate PDF files as a report. I'm trying
I have an excel workbook vsto solution that needs to generate a pdf copy
I have generated a pdf file with password protection by using the following code:
I have added wicked_pdf plugin in my rails applications to generate pdf. It works
I have written the following code to generate pdf and the pdf i generated
I have a class which generate PDF dynamically, in that I have a 4-6
I have been using XSL-FO and FOP Engine to generate PDF documents for required
I have the following code which will generate two pdf files containing plots to

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.