Class: Workarea::Admin::DataFileExportsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/data_file_exports_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
# File 'app/controllers/workarea/admin/data_file_exports_controller.rb', line 14

def create
  if @export.save
    flash[:success] = t('workarea.admin.data_file_exports.flash_messages.processing')
    redirect_to return_to.presence || root_path
  else
    render :new, status: :unprocessable_entity
  end
end

#newObject



11
12
# File 'app/controllers/workarea/admin/data_file_exports_controller.rb', line 11

def new
end

#showObject



6
7
8
9
# File 'app/controllers/workarea/admin/data_file_exports_controller.rb', line 6

def show
  export = DataFile::Export.find(params[:id])
  send_file export.file.file, filename: export.file_name
end