Generate page with inline JS and CSS with Rails

146 Views Asked by At

I'm using Rails 3.1. My JavaScript and CSS files are included in usual way:

<%= stylesheet_link_tag    "application" %>
<%= javascript_include_tag "application" %>

Now I want to create standalone version of existing page with default layout. I want it to be a single html file that user can download and use in offline. So, JavaScript and CSS code must be included in content of this file. How can I do this?

1

There are 1 best solutions below

0
On

You can create a separate CSS and JS and include them in config.assets.precompile key in the file config/application.rb.

Check this link