2011-10-30 23:02:41 +00:00
|
|
|
module Locomotive
|
2011-07-04 13:25:02 +00:00
|
|
|
class ExportController < BaseController
|
|
|
|
|
|
|
|
skip_load_and_authorize_resource
|
|
|
|
|
|
|
|
before_filter :authorize_export
|
|
|
|
|
|
|
|
def new
|
|
|
|
zipfile = ::Locomotive::Export.run!(current_site, current_site.name.parameterize)
|
|
|
|
send_file zipfile, :type => 'application/zip', :disposition => 'attachment'
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def authorize_export
|
|
|
|
authorize! :export, Site
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|