Class: Workarea::Admin::DataFileImportsController
Instance Method Summary
collapse
#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
#create ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'app/controllers/workarea/admin/data_file_imports_controller.rb', line 14
def create
if @import.save
flash[:success] = t('workarea.admin.data_file_imports.flash_messages.processing')
redirect_to return_to.presence || root_path
else
render :new, status: :unprocessable_entity
end
end
|
#new ⇒ Object
6
7
|
# File 'app/controllers/workarea/admin/data_file_imports_controller.rb', line 6
def new
end
|
#sample ⇒ Object
9
10
11
12
|
# File 'app/controllers/workarea/admin/data_file_imports_controller.rb', line 9
def sample
filename = "#{@import.name.downcase.underscore}.#{@import.file_type}"
send_data @import.sample_file_content, filename: filename, type: @import.file_type
end
|