Sha256: 4cc42c887d3dfbf122032c24bff8969c629f708736055251238ac693fc0efc84
Contents?: true
Size: 566 Bytes
Versions: 9
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true class Avo::Views::ResourceEditComponent < ViewComponent::Base include Avo::ResourcesHelper include Avo::ApplicationHelper def initialize(resource: nil) @resource = resource end def back_path if via_resource? helpers.resource_path(params[:via_resource_class].safe_constantize, resource_id: params[:via_resource_id]) else helpers.resource_path(@resource.model) end end private def via_resource? params[:via_resource_class].present? and params[:via_resource_id].present? end end
Version data entries
9 entries across 9 versions & 1 rubygems