You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Naomi Dushay edited this page Feb 2, 2016
·
2 revisions
require 'mods_display' in code
bundle install
you'll want a model something like this:
require 'mods_display'
class ModsDisplayModel
attr_accessor :modsxml
include ModsDisplay::ModelExtension
include ModsDisplay::ControllerExtension
def initialize mods
@modsxml = mods
end
mods_xml_source do |doc|
doc.modsxml
end
end
let's say the MODS xml is in a var called mods_xml:
mm = ModsDisplayModel.new(mods_xml)
now you can access stuff like this:
mm.render_mods_display(mm).imprint
where imprint is one of the mods_display fields: lib/mods_display/fields