- How to preload file via Carrierwave for api?
- How to preload huge file before sending all form?
Carrierwave doesn't give approach for preloading file, so there is simple implementation.
Carrierwave doesn't give approach for preloading file, so there is simple implementation.
#!/usr/bin/env ruby | |
APP_PATH = File.expand_path('../config/application', __FILE__) | |
require File.expand_path('../config/environment', __FILE__) | |
require_relative 'config/boot' | |
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) | |
module Mod | |
module_function | |
def method1 |
# The way to insert some xml into building xml with correct indents | |
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml| | |
xml.Batch do | |
xml.Count 1 | |
end | |
end | |
batch_xml_element = builder.doc.at('Batch') | |
xml_text = '<Element><One>1</One><Two>2</Two></Element>' |
require 'combine_pdf' # https://github.com/boazsegev/combine_pdf | |
input_filename = ARGV[0] | |
if input_filename.empty? | |
puts 'ERROR:' | |
puts 'Enter filename' | |
return | |
end |
start new rails project with docker |