Class: AppyantraAdmin::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/appyantra_admin/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_breadcrumb(breadcrumb) ⇒ Object



15
16
17
18
# File 'app/controllers/appyantra_admin/application_controller.rb', line 15

def add_breadcrumb(breadcrumb)
	@breadcrumbs = Queue.new unless @breadcrumbs
	@breadcrumbs << breadcrumb
end

#asset_display_name(asset) ⇒ Object



24
25
26
27
# File 'app/controllers/appyantra_admin/application_controller.rb', line 24

def asset_display_name(asset)
  field_name = asset.class.column_names[1]
  asset[field_name]
end

#current_breadcrumb(breadcrumb) ⇒ Object



20
21
22
# File 'app/controllers/appyantra_admin/application_controller.rb', line 20

def current_breadcrumb(breadcrumb)
	@current_breadcrumb = breadcrumb
end

#get_object_name(asset_class) ⇒ Object



11
12
13
# File 'app/controllers/appyantra_admin/application_controller.rb', line 11

def get_object_name(asset_class)
  asset_class.table_name.singularize
end

#set_objectsObject



7
8
9
# File 'app/controllers/appyantra_admin/application_controller.rb', line 7

def set_objects
  @assets = AppyantraAdmin.assets
end