Sha256: ecf5f3b6eda2bc335d748e2ffba4326219afad715e13b13b7182773edb974e2c
Contents?: true
Size: 898 Bytes
Versions: 35
Compression:
Stored size: 898 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_name.underscore}/details" end end end
Version data entries
35 entries across 35 versions & 1 rubygems