Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/hancock/catalog/routes.rb

Instance Method Summary collapse

Instance Method Details

#hancock_cms_catalog_routes(config = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/hancock/catalog/routes.rb', line 3

def hancock_cms_catalog_routes(config = {})
  routes_config = {
    use_items_path: true,
    use_categories_path: true,
    use_catalog_path: true,
    catalog_path: '/',
    catalog_scope: '/catalog',
    classes: {
      items: :items,
      categories: :categories,
      catalog_controller: :categories
    },
    paths: {
      items: :items,
      categories: :categories
    },
    pagination: {
      items: true,
      categories: true,
      category_items: true
    },
    actions: {
      items: [:show],
      categories: [:show],
    }
  }
  routes_config.deep_merge!(config)

  generate_hancock_catalog_user_routes(routes_config)
  generate_hancock_catalog_cms_routes(routes_config)
end