Module: Admin::StructuresHelper

Defined in:
lib/generators/ab_admin/install/templates/helpers/admin/structures_helper.rb

Instance Method Summary collapse

Instance Method Details

#edit_structure_record_path(structure) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/ab_admin/install/templates/helpers/admin/structures_helper.rb', line 3

def edit_structure_record_path(structure)
  case structure.structure_type
    when StructureType.static_page, StructureType.main
      if structure.static_page
        edit_admin_structure_static_page_path(structure_id: structure.id)
      else
        new_admin_structure_static_page_path(structure_id: structure.id)
      end
    when StructureType.posts
      '#'
    when StructureType.redirect
      edit_admin_structure_path(structure)
    when StructureType.group
      '#'
    else
      '#'
  end
end