sul-dlss/argo

View on GitHub
app/controllers/metadata_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

class MetadataController < ApplicationController
  # Shows the modal with the MODS XML. This is triggered by the "MODS" button on
  # the item show page.
  def descriptive
    xml = PurlFetcher::Client::Mods.create(cocina:)
    @mods_display = ModsDisplay::Record.new(xml).mods_display_html

    respond_to do |format|
      format.html { render layout: !request.xhr? }
    end
  end

  private

  def cocina
    Repository.find(params[:item_id])
  end
end