Sha256: 9ce1fb5be0702e132f533e9d94f614aa9827146c7b1dc961fd2f2aa6f599ed86
Contents?: true
Size: 1.12 KB
Versions: 11
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true module Katalyst module Content module Editor class ItemEditorComponent < BaseComponent include ::Turbo::FramesHelper module Helpers def prefix_partial_path_with_controller_namespace false end def content_routes katalyst_content end end def call tag.div(**html_attributes) do helpers.extend(Helpers) helpers.render(item, path:) end end def id "item-editor-#{item.id}" end def title if item.persisted? "Edit #{item.model_name.human.downcase}" else "New #{item.model_name.human.downcase}" end end def path if item.persisted? view_context.katalyst_content.item_path(item) else view_context.katalyst_content.items_path end end def default_html_attributes { id:, class: "content--item-editor", } end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems