class ActionDispatch::Routing::Mapper

Public Instance Methods

comfy_route_archive(options = {}) click to toggle source
# File lib/comfy_archive/routes/archive.rb, line 5
def comfy_route_archive(options = {})
  scope module: :comfy, as: :comfy do
    namespace :archive, path: options[:path] do
      with_options constraints: { year: %r{\d{4}}, month: %r{\d{1,2}} } do |o|
        o.get "*cms_path/:year",          to: "index#index", as: :pages_of_year
        o.get "*cms_path/:year/:month",   to: "index#index", as: :pages_of_month
      end
      get "*cms_path/category/:category", to: "index#index", as: :pages_of_category
      get "(*cms_path)",                  to: "index#index", as: :render_page, action: "/:format"
    end
  end
end
comfy_route_archive_admin(options = {}) click to toggle source
# File lib/comfy_archive/routes/archive_admin.rb, line 5
def comfy_route_archive_admin(options = {})
  options[:path] ||= "admin"
  path = [options[:path], "sites", ":site_id"].join("/")

  scope module: :comfy, as: :comfy do
    scope module: :admin do
      namespace :archive, as: :admin, path: path, except: [:show] do
        resources :indices, as: :archive_indices, path: "archive-indices" do
          get :form_fragments, on: :member
        end
      end
    end
  end
end