Skip to content

Commit

Permalink
Update language on using config.assets.precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
unixmonkey authored Mar 15, 2017
1 parent 90d05c6 commit 690d001
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ Using wicked_pdf_helpers with asset pipeline raises `Asset names passed to helpe
</html>
```

#### Asset pipeline usage

It is best to precompile assets used in PDF views. This will help avoid issues when it comes to deploying, as Rails serves asset files differently between development and production (`config.assets.comple = false`), which can make it look like your PDFs work in development, but fail to load assets in production.

config.assets.precompile += ['blueprint/screen.css', 'pdf.css', 'jquery.ui.datepicker.js', 'pdf.js', ...etc...]

#### CDN reference

In this case, you can use that standard Rails helpers and point to the current CDN for whichever framework you are using. For jQuery, it would look somethng like this, given the current versions at the time of this writing.
Expand All @@ -116,11 +122,6 @@ In this case, you can use that standard Rails helpers and point to the current C
<%= javascript_include_tag "http://code.jquery.com/jquery-1.10.0.min.js" %>
<%= javascript_include_tag "http://code.jquery.com/ui/1.10.3/jquery-ui.min.js" %>
```
#### Asset pipeline usage

The way to handle this for the asset pipeline on Heroku is to include these files in your asset precompile list, as follows:

config.assets.precompile += ['blueprint/screen.css', 'pdf.css', 'jquery.ui.datepicker.js', 'pdf.js', ...etc...]

### Advanced Usage with all available options
```ruby
Expand Down

0 comments on commit 690d001

Please sign in to comment.