Sha256: ae536b06fb9f8556c6008bb583a8318152847c129e9c3ec0111e6d1e76776081
Contents?: true
Size: 893 Bytes
Versions: 14
Compression:
Stored size: 893 Bytes
Contents
module ScrivitoContentBrowser class ContentBrowserController < ApplicationController # Return JSON responses without layout information. layout false # Render a JSON response that holds the content browser inspector markup. The inspector either # renders the details view for the selected object, or a fallback view that is located under # 'app/views/obj/details'. def inspector @obj = Obj.find(params[:id]) options = { layout: 'scrivito_content_browser/inspector', } content = begin render_to_string(details_view_template(@obj), options) rescue ActionView::MissingTemplate render_to_string('scrivito_content_browser/obj/details', options) end render json: { content: content } end private def details_view_template(obj) "#{obj.obj_class.underscore}/details" end end end
Version data entries
14 entries across 14 versions & 1 rubygems