to_spreadsheet 1.0.6 → 1.0.7
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: 7bc03e5c897fae15afdda71d0d98a405032b495459c82f0944b3e2266875679b
|
4
|
+
data.tar.gz: f330f6898c87f33cc6651533bfcfb2daaabfa9f5f6691f8df8f3c7cc7cbb71e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4668c0f720945b9e123ed8b153c997f32ab831c726a04d1648ba47e85df77d2f3bc4024459a3507c6c3b66e65930aabd540ab4befd662cb5ddeade3de52207d4
|
7
|
+
data.tar.gz: 4e1ead53e8ad461797d8c8126a3e5afb51e7db55186f4ccba23ea574e13ccc31cb2e681f8b341f84830d7fa0ee636f9ce74767063d73f37efebaca7bc12ba40d
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ In the controller:
|
|
17
17
|
```ruby
|
18
18
|
# my_thingies_controller.rb
|
19
19
|
class MyThingiesController < ApplicationController
|
20
|
-
respond_to :
|
20
|
+
respond_to :xlsx, :html
|
21
21
|
def index
|
22
22
|
@my_items = MyItem.all
|
23
23
|
respond_to do |format|
|
@@ -49,7 +49,7 @@ In the view partial:
|
|
49
49
|
|
50
50
|
In the XLSX view:
|
51
51
|
```haml
|
52
|
-
# index.
|
52
|
+
# index.xlsx.haml
|
53
53
|
= render 'my_items', my_items: @my_items
|
54
54
|
```
|
55
55
|
|
@@ -17,7 +17,7 @@ end
|
|
17
17
|
ActionController::Renderers.add ToSpreadsheet.renderer do |template, options|
|
18
18
|
filename = options[:filename] || options[:template] || 'data'
|
19
19
|
data = ToSpreadsheet::Context.with_context ToSpreadsheet::Context.global.merge(ToSpreadsheet::Context.new) do |context|
|
20
|
-
html = render_to_string(template, options.merge(template: template.to_s, formats: [
|
20
|
+
html = render_to_string(template, options.merge(template: template.to_s, formats: [:xlsx, :html]))
|
21
21
|
ToSpreadsheet::Renderer.to_data(html, context)
|
22
22
|
end
|
23
23
|
send_data data, type: ToSpreadsheet.renderer, disposition: %(attachment; filename="#{filename}.xlsx")
|
@@ -18,7 +18,7 @@ module ToSpreadsheet
|
|
18
18
|
sheet.col_style selector_query, inline_styles if inline_styles.present?
|
19
19
|
apply_col_info sheet.column_info[selector_query]
|
20
20
|
when :range
|
21
|
-
add_and_apply_style wb, range_match(
|
21
|
+
add_and_apply_style wb, range_match(selector_query, sheet), context
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -174,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
|
178
|
-
rubygems_version: 2.4.8
|
177
|
+
rubygems_version: 3.0.6
|
179
178
|
signing_key:
|
180
179
|
specification_version: 4
|
181
180
|
summary: Render existing views as Excel documents with style!
|