Class: Backend::DocumentsController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/documents_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_theme

Instance Method Summary collapse

Methods inherited from BaseController

account_lettering_states_crit, accounts_range_crit, amount_range_crit, crit_params, journal_entries_states_crit, journal_letter_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name, #session_controller?

Instance Method Details

#showObject


43
44
45
46
47
48
49
50
51
52
# File 'app/controllers/backend/documents_controller.rb', line 43

def show
  return unless @document = find_and_check
  respond_to do |format|
    format.html { t3e @document }
    format.json
    format.xml { send_data(File.read(@document.file.path), type: 'application/xml', filename: @document.file_file_name) }
    format.pdf { send_file(@document.file.path(params[:format] != :default ? :original : :default), disposition: 'inline', filename: @document.file_file_name) }
    format.jpg { send_file(@document.file.path(:thumbnail), disposition: 'inline') }
  end
end