Sha256: 5f1d27f35445c3fc916c407a7e15d242b9cf71f2db6a75f074cdaa14bbfe15f1

Contents?: true

Size: 799 Bytes

Versions: 16

Compression:

Stored size: 799 Bytes

Contents

require_dependency "renalware/letters"

module Renalware
  module Letters
    class CompletedLettersController < Letters::BaseController
      before_action :load_patient

      # HTML GET for insertion into modal dialog
      def new
        render layout: false, locals: {
          letter: letter
        }
      end

      def create
        CompleteLetter.build(letter).call(by: current_user)

        respond_to do |format|
          format.html do
            redirect_to patient_letters_letter_path(@patient, letter), notice: t(".success")
          end
          format.js do
            render locals: { letter: letter }
          end
        end
      end

      private

      def letter
        @letter ||= @patient.letters.approved.find(params[:letter_id])
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.15 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.14 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.13 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.12 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.11 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.9 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.8 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.7 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.5 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.4 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.3 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.2 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.1 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.0 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.0.pre.rc13 app/controllers/renalware/letters/completed_letters_controller.rb