Module: FcrepoAdmin::Helpers::AssociationsHelperBehavior
- Included in:
- AssociationsHelper
- Defined in:
- lib/fcrepo_admin/helpers/associations_helper_behavior.rb
Instance Method Summary collapse
- #link_to_association_target(association) ⇒ Object
-
#safe_paginate_rsolr_response(response) ⇒ Object
We attempted to use Blacklight’s #paginate_rsolr_response, but it causes a routing error b/c Kaminari as of version 0.14.1 cannot handle namespace-prefixed routes.
Instance Method Details
#link_to_association_target(association) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fcrepo_admin/helpers/associations_helper_behavior.rb', line 4 def link_to_association_target(association) target = @object.send(association.name) if association.collection? size = target.size link_to_unless size == 0, "#{association.class_name} (#{size})", fcrepo_admin.object_association_path(@object, association.name) do |text| text end else # not a collection if target link_to "#{association.class_name} #{target.pid}", fcrepo_admin.object_path(target) else "#{association.class_name} (not assigned)" end end end |
#safe_paginate_rsolr_response(response) ⇒ Object
We attempted to use Blacklight’s #paginate_rsolr_response, but it causes a routing error b/c Kaminari as of version 0.14.1 cannot handle namespace-prefixed routes. The fallback rendering bypasses Kaminari, but doesn’t look so good on a large page set. See github.com/amatsuda/kaminari/pull/322.
24 25 26 |
# File 'lib/fcrepo_admin/helpers/associations_helper_behavior.rb', line 24 def safe_paginate_rsolr_response(response) render :partial => "fcrepo_admin/pagination/links", :locals => {:response => response} end |