Module: NdlBooksHelper

Defined in:
app/helpers/ndl_books_helper.rb

Instance Method Summary collapse

Instance Method Details



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/ndl_books_helper.rb', line 3

def link_to_import(nbn)
  if nbn.blank?
    t('enju_ndl.not_available')
  else
    manifestation = Manifestation.where(:nbn => nbn).first
    unless manifestation
      link_to t('enju_ndl.add'), ndl_books_path(:book => {:nbn => nbn}), :method => :post
    else
      link_to t('enju_ndl.already_exists'), manifestation
    end
  end
end