Sha256: df10a5c1040b84f33974e0afcdf47839abda5f73757221bba1fbb6519093114a

Contents?: true

Size: 624 Bytes

Versions: 5

Compression:

Stored size: 624 Bytes

Contents

# -*- encoding: utf-8 -*-
module CiniiBooksHelper
  def link_to_import_from_cinii(ncid)
    if ncid.blank?
      t('enju_nii.not_available')
    else
      identifier_type = IdentifierType.where(name: 'ncid').first
      if identifier_type
        manifestation = Identifier.where(body: ncid, identifier_type_id: identifier_type.id).first.try(:manifestation)
      end
      unless manifestation
        button_to t('enju_nii.add'), cinii_books_path(book: {ncid: ncid}), method: :post, data: {disable_with: t('page.saving')}
      else
        link_to t('enju_nii.already_exists'), manifestation
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enju_nii-0.3.2 app/helpers/cinii_books_helper.rb
enju_nii-0.3.1 app/helpers/cinii_books_helper.rb
enju_nii-0.4.0.beta.1 app/helpers/cinii_books_helper.rb
enju_nii-0.3.0 app/helpers/cinii_books_helper.rb
enju_nii-0.3.0.beta.1 app/helpers/cinii_books_helper.rb