Sha256: b44a649c2226d2b2bcfcd5e2607cd44434a1b09d4a16a1cfc852e0621024fc62

Contents?: true

Size: 774 Bytes

Versions: 2

Compression:

Stored size: 774 Bytes

Contents

require 'workbook'
require 'workbook_rails/template_handler'

module WorkbookRails
  class Engine < Rails::Engine
    initializer 'workbook_rails.action_view' do
      ActiveSupport.on_load :action_view do
        ::ActionView::Template.register_template_handler :wb, WorkbookRails::TemplateHandler
      end
    end

    initializer 'workbook_rails.action_controller' do
      ActiveSupport.on_load :action_controller do
        require 'workbook_rails/action_controller'
      end
    end

    unless Mime::Type.lookup_by_extension(:xlsx)
      Mime::Type.register "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", :xlsx
    end
    unless Mime::Type.lookup_by_extension(:xls)
      Mime::Type.register "application/vnd.ms-excel", :xls
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workbook_rails-0.1.1 lib/workbook_rails/engine.rb
workbook_rails-0.1.0 lib/workbook_rails/engine.rb