Module: Tramway::Admin::ApplicationHelper

Includes:
AuthManagement, FontAwesome5::Rails::IconHelper, SmartButtons, AdditionalButtonsBuilder, CasesHelper, FocusGeneratorHelper, InputsHelper, NavbarHelper, RecordsHelper, RussianCasesHelper, SingletonHelper, Collections::Helper, Core::CopyToClipboardHelper
Defined in:
app/helpers/tramway/admin/application_helper.rb

Instance Method Summary collapse

Methods included from FocusGeneratorHelper

#focus_selector

Methods included from InputsHelper

#association_params, #polymorphic_association_params, #value_from_params

Methods included from NavbarHelper

#customized_admin_navbar, #customized_admin_navbar_given?

Methods included from SingletonHelper

#current_model_singleton_path, #edit_current_model_singleton_path

Methods included from RecordsHelper

#active_tab, #admin_index_path_of_model, #collection_human_name, #current_model_record_path, #current_model_records_path, #decorator_class, #edit_current_model_record_path, #get_collection, #model_class, #new_associated_record_path, #new_current_model_record_path, #public_path, #search_tab_title, #searchable_model?, #tab_title, #to_path

Methods included from RussianCasesHelper

#case_word, #dative, #genitive, #instrumental, #russian_plural

Methods included from CasesHelper

#plural

Methods included from AdditionalButtonsBuilder

#build_buttons

Instance Method Details

#object_type(object) ⇒ Object



20
21
22
23
24
25
26
27
# File 'app/helpers/tramway/admin/application_helper.rb', line 20

def object_type(object)
  object_class_name = if object.class.ancestors.include? ::Tramway::Core::ApplicationDecorator
                        object.class.model_class.name
                      else
                        object.class.name
                      end
  ::Tramway::Admin.available_models_for(@application_engine || @application.name).map(&:to_s).include?(object_class_name) ? :record : :singleton
end