Preview method for multiple types of panels
I don't know your class but it looks like your object can have different subclasses depending on object.panel_type (maybe a single table inheritance?) and every subclass implements it's own preview method.

 class Image &lt; BaseClass
  def preview
      asset_image_path(object.asset)
  end
end

class Slider &lt; BaseClass
  def preview
       if object.options.present? &amp;&amp; object.options["slides"].present?
          Slide.find(object.options["slides"][0]).headline
       else
         "Empty"
       end
  end
end