Class: Ruby2xlsx::Xrb

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby2xlsx/xrb.rb

Instance Method Summary collapse

Instance Method Details

#call(template) ⇒ Object



7
8
9
10
11
12
# File 'lib/ruby2xlsx/xrb.rb', line 7

def call(template)
  %{ controller.send_data ::Ruby2xlsx::Template.new(#{template.source.inspect}).render(self, assigns.merge(local_assigns)),
      :filename => [controller.action_name, ".xls"].join, 
      :type => "application/vnd.ms-excel", 
      :disposition => "attachment" }
end