Module: TitleBarPatch
- Included in:
- ActiveAdmin::Views::TitleBar
- Defined in:
- lib/activeadmin_custom_layout/layout/title_bar.rb
Instance Method Summary collapse
- #build(*args) ⇒ Object
- #build_action_items ⇒ Object
- #build_breadcrumb(separator = "/") ⇒ Object
- #build_title_tag ⇒ Object
- #build_titlebar_right ⇒ Object
- #export_aa_data_actions ⇒ Object
- #export_aa_data_breadcrumbs ⇒ Object
Instance Method Details
#build(*args) ⇒ Object
2 3 4 5 6 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 2 def build(*args) super self.aa_data[:action_items] = export_aa_data_actions self.aa_data[:breadcrumbs] = end |
#build_action_items ⇒ Object
14 15 16 17 18 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 14 def build_action_items arbre_content_for :action_items do super end end |
#build_breadcrumb(separator = "/") ⇒ Object
20 21 22 23 24 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 20 def (separator = "/") arbre_content_for :breadcrumb do super end end |
#build_title_tag ⇒ Object
26 27 28 29 30 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 26 def build_title_tag arbre_content_for :title_tag do super end end |
#build_titlebar_right ⇒ Object
8 9 10 11 12 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 8 def arbre_content_for :titlebar_right do super end end |
#export_aa_data_actions ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 32 def export_aa_data_actions action_data = [] @action_items.each do |action_item| action_data.push({ name: action_item.name, action: instance_exec(&action_item.block) }) end action_data end |
#export_aa_data_breadcrumbs ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/activeadmin_custom_layout/layout/title_bar.rb', line 45 def = [] = active_admin_config && active_admin_config. links = if .is_a?(Proc) instance_exec(controller, &active_admin_config.) elsif .present? end if links.present? && links.is_a?(::Array) links.each do |url| .push({ url: "#{url}" }) end end end |