app/controllers/admin/manager_controller.rb in ab_admin-0.8.2 vs app/controllers/admin/manager_controller.rb in ab_admin-0.8.3
- old
+ new
@@ -140,11 +140,12 @@
end
end
def preview_resource_path(item)
return unless manager.preview_path
+ return if manager.preview_path[:options][:if] && !call_method_or_proc_on(item, manager.preview_path[:options][:if])
I18n.with_locale I18n.default_locale do
- manager.preview_path.is_a?(Proc) ? instance_exec(item, &manager.preview_path) : send(manager.preview_path, item)
+ manager.preview_path[:value].is_a?(Proc) ? instance_exec(item, &manager.preview_path[:value]) : send(manager.preview_path[:value], item)
end
end
def admin_partial_name(builder)
builder.partial ||= begin