thinreports-handler 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -15
- data/lib/thinreports-handler/template_handler.rb +1 -1
- data/lib/thinreports-handler/version.rb +2 -4
- data/thinreports-handler.gemspec +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# ThinreportsHandler
|
2
2
|
ThinReporsHandler is constructed by Rails Template Handler [ThinReports](http://www.thinreports.org/ "ThinReposts") the PDF.
|
3
3
|
|
4
4
|
## Supported versions
|
@@ -23,12 +23,12 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
-
###
|
26
|
+
### Example to, Display in the browser.
|
27
27
|
|
28
28
|
#### Controllers
|
29
29
|
``` ruby
|
30
30
|
class OrdersController < ApplicationController
|
31
|
-
def
|
31
|
+
def index
|
32
32
|
@orders = Order.all
|
33
33
|
end
|
34
34
|
end
|
@@ -39,7 +39,7 @@ end
|
|
39
39
|
app/views/orders/index.pdf.thinreports
|
40
40
|
|
41
41
|
``` ruby
|
42
|
-
report.set_layout
|
42
|
+
report.set_layout # ! <= Required. default use: orders/index.tlf
|
43
43
|
report.start_new_page
|
44
44
|
report.page.values printed_at: Time.now
|
45
45
|
@orders.each do |order|
|
@@ -50,11 +50,11 @@ report.page.values printed_at: Time.now
|
|
50
50
|
end
|
51
51
|
```
|
52
52
|
|
53
|
-
### Download
|
53
|
+
### Example to, Download PDF.
|
54
54
|
|
55
55
|
``` ruby
|
56
56
|
class OrdersController < ApplicationController
|
57
|
-
def
|
57
|
+
def index
|
58
58
|
@orders = Order.all
|
59
59
|
respond_to do |format|
|
60
60
|
format.pdf {
|
@@ -67,13 +67,15 @@ end
|
|
67
67
|
|
68
68
|
### Configuration
|
69
69
|
|
70
|
-
###
|
70
|
+
### Layout file(.tlf) and options.
|
71
71
|
|
72
|
-
|
73
|
-
Write code like this to index.pdf.thinreports
|
72
|
+
Example of using the `app/views/reports/index.tlf`.
|
73
|
+
Write code like this to `index.pdf.thinreports`.
|
74
|
+
|
75
|
+
`:layout_options` is an option `ThinReports::Report::Base#use_layout` method.
|
74
76
|
|
75
77
|
``` ruby
|
76
|
-
report.set_layout 'reports/index'
|
78
|
+
report.set_layout tlf: 'reports/index', layout_options: { default: true }
|
77
79
|
```
|
78
80
|
|
79
81
|
### generate options.
|
@@ -91,17 +93,17 @@ report.generate_options(security: {
|
|
91
93
|
|
92
94
|
### Partial
|
93
95
|
|
94
|
-
For exsample to use, app/views/orders/_header.pdf.thinreports
|
95
|
-
title is local variable in _header.pdf.thinreports
|
96
|
+
For exsample to use, `app/views/orders/_header.pdf.thinreports`.
|
97
|
+
`title` is local variable in `_header.pdf.thinreports`.
|
96
98
|
|
97
99
|
``` ruby
|
98
|
-
report.partial 'header', title: title
|
100
|
+
report.partial! 'header', title: title
|
99
101
|
```
|
100
102
|
|
101
103
|
## Authour
|
102
104
|
|
103
|
-
TwitterID: @takeshinoda
|
104
|
-
Blog: http://d.hatena.ne.jp/takeshinoda/
|
105
|
+
* TwitterID: @takeshinoda
|
106
|
+
* Blog: http://d.hatena.ne.jp/takeshinoda/
|
105
107
|
|
106
108
|
## Contributing
|
107
109
|
|
data/thinreports-handler.gemspec
CHANGED
@@ -13,6 +13,6 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "thinreports-handler"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version =
|
16
|
+
gem.version = ThinreportsHandler::VERSION
|
17
17
|
gem.add_dependency "thinreports", '~>0.7.0'
|
18
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thinreports-handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thinreports
|