Sha256: c2e0d4e80ad17c728d7e50d0a6dfbe74f688babbb5c26ac68a9f90edfa155c9a

Contents?: true

Size: 577 Bytes

Versions: 4

Compression:

Stored size: 577 Bytes

Contents

module LocSearchHelper
  def link_to_import_from_loc(lccn)
    if lccn.blank?
      t('enju_loc.not_available')
    else
      identifier_type = IdentifierType.where(:name => 'lccn').first
      if identifier_type
        manifestation = Identifier.where(:body => lccn, :identifier_type_id => identifier_type
.id).first.try(:manifestation)
      end
      unless manifestation
        link_to t('enju_loc.add'), loc_search_index_path(:book => {:lccn => lccn}), :method => :post
      else
        link_to t('enju_loc.already_exists'), manifestation
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_loc-0.1.0.pre4 app/helpers/loc_search_helper.rb
enju_loc-0.1.0.pre3 app/helpers/loc_search_helper.rb
enju_loc-0.1.0.pre2 app/helpers/loc_search_helper.rb
enju_loc-0.1.0.pre1 app/helpers/loc_search_helper.rb