prawn_cocktail_rails 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ef8156cc6673d1a9cf46289e5321a4a4ccba3fb6592c99ab2a93b929aff4c33b
|
4
|
+
data.tar.gz: eb48652b4e495b6336c34a14a92d71cebfb2f566a9aaa7dae9c6418c285ba75c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ebe4993941ec855617944660dd4685c2621e43da8d16fb73795895f05e87863e16f807cc6f677010a2978929db28faef0e7cd01006197f31d43bce686a547fb
|
7
|
+
data.tar.gz: 644e8fb3b19cb173d4a0d5708f1615a78529f8fa5385811248e1144470a9c28be5ea9634bafdfd244edd03f5efdf8e5a101e3379de85925d3f8daa2fc6280249
|
data/README.md
CHANGED
@@ -20,6 +20,7 @@ class InvoicesController < ApplicationController
|
|
20
20
|
end
|
21
21
|
```
|
22
22
|
|
23
|
+
You can change disposition with `send_pdf(document, disposition: "inline")`, without the option it will default to `"attachment"`.
|
23
24
|
|
24
25
|
It configures PrawnCocktail to look for its views in `app/views/documents`.
|
25
26
|
|
@@ -2,11 +2,13 @@ module PrawnCocktailRails
|
|
2
2
|
module Controller
|
3
3
|
private
|
4
4
|
|
5
|
-
def send_pdf(document)
|
5
|
+
def send_pdf(document, opts = {})
|
6
|
+
disposition = opts.fetch(:disposition, "attachment")
|
7
|
+
|
6
8
|
send_data(
|
7
9
|
document.render,
|
8
10
|
type: :pdf,
|
9
|
-
disposition:
|
11
|
+
disposition: disposition,
|
10
12
|
filename: document.filename
|
11
13
|
)
|
12
14
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn_cocktail_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Nyh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn_cocktail
|
@@ -82,7 +82,7 @@ files:
|
|
82
82
|
- lib/prawn_cocktail_rails/controller.rb
|
83
83
|
- lib/prawn_cocktail_rails/railtie.rb
|
84
84
|
- lib/prawn_cocktail_rails/version.rb
|
85
|
-
-
|
85
|
+
- prawn_cocktail_rails.gemspec
|
86
86
|
- spec/dummy/.gitignore
|
87
87
|
- spec/dummy/Rakefile
|
88
88
|
- spec/dummy/app/controllers/application_controller.rb
|
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 2.4.5
|
123
|
+
rubygems_version: 3.0.3
|
125
124
|
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: Simple documents, templates and helpers on top of Prawn. In Ruby on Rails.
|