@@ -18,8 +18,8 @@ Status](https://coveralls.io/repos/straydogstudio/axlsx_rails/badge.svg)](https:
1818In your Gemfile:
1919
2020``` ruby
21- gem ' rubyzip' , ' ~> 1.1.0 '
22- gem ' axlsx' , ' 2.1.0.pre '
21+ gem ' rubyzip' , ' >= 1.2.1 '
22+ gem ' axlsx' , git: ' https://github.com/randym/axlsx.git ' , ref: ' c8ac844 '
2323gem ' axlsx_rails'
2424```
2525
@@ -31,11 +31,11 @@ gem 'axlsx', '= 2.0.1'
3131gem ' axlsx_rails'
3232```
3333
34- If ` rubyzip >= 1.2.1 ` is needed:
34+ If ` rubyzip >= 1.1.0 ` is needed:
3535
3636``` ruby
37- gem ' rubyzip' , ' >= 1.2.1 '
38- gem ' axlsx' , git: ' https://github.com/randym/axlsx.git ' , ref: ' 776037c0fc799bb09da8c9ea47980bd3bf296874 '
37+ gem ' rubyzip' , ' ~> 1.1.0 '
38+ gem ' axlsx' , ' 2.1.0.pre '
3939gem ' axlsx_rails'
4040```
4141
@@ -202,7 +202,7 @@ class UserMailer < ActionMailer::Base
202202 def export (users )
203203 xlsx = render_to_string layout: false , handlers: [:axlsx ], formats: [:xlsx ], template: " users/export" , locals: {users: users}
204204 attachment = Base64 .encode64(xlsx)
205- attachments[" Users.xlsx" ] = {mime_type: Mime :: XLSX , content: attachment, encoding: ' base64' }
205+ attachments[" Users.xlsx" ] = {mime_type: Mime [ :xlsx ] , content: attachment, encoding: ' base64' }
206206 # self.instance_variable_set(:@_lookup_context, nil) # If attachments are rendered as content, try this and open an issue
207207 ...
208208 end
@@ -241,7 +241,7 @@ If you are having problems with rendering a template and attaching it to a templ
241241class UserMailer < ActionMailer ::Base
242242 def export (users )
243243 xlsx = render_to_string handlers: [:axlsx ], formats: [:xlsx ], template: " users/export" , locals: {users: users}
244- attachments[" Users.xlsx" ] = {mime_type: Mime :: XLSX , content: xlsx, encoding: ' base64' }
244+ attachments[" Users.xlsx" ] = {mime_type: Mime [ :xlsx ] , content: xlsx, encoding: ' base64' }
245245 # self.instance_variable_set(:@_lookup_context, nil) # If attachments are rendered as content, try this and open an issue
246246 ...
247247 end
0 commit comments