Sha256: a9ce857745100abaca87fbd1527030ebea8ffdcfbca7b987445cc092696f71e4
Contents?: true
Size: 1.93 KB
Versions: 3
Compression:
Stored size: 1.93 KB
Contents
Storytime::Engine.routes.draw do resources :comments namespace :dashboard, :path => Storytime.dashboard_namespace_path do get "/", to: "posts#index" resources :sites, only: [:new, :edit, :update, :create] resources :posts, except: [:show], shallow: true do resources :autosaves, only: [:create] end resources :snippets, except: [:show] resources :media, except: [:show, :edit, :update] resources :imports, only: [:new, :create] resources :users resources :roles do collection do patch :update_multiple end end end get 'tags/:tag', to: 'posts#index', as: :tag # using a page as the home page constraints ->(request){ Storytime::Site.first && Storytime::Site.first.root_page_content == "page" } do get Storytime.home_page_path, to: "pages#show", as: :storytime_root_post resources :posts, only: :index end # using blog index as the home page constraints ->(request){ Storytime::Site.first && Storytime::Site.first.root_page_content == "posts" } do resources :posts, path: Storytime.home_page_path, only: :index, as: :storytime_root_post end # index page for post types that are excluded from primary feed constraints ->(request){ Storytime.post_types.any?{|type| type.constantize.type_name.pluralize == request.path.gsub("/", "") } } do get ":post_type", to: "posts#index" end # pages at routes like /about constraints ->(request){ Storytime::Page.friendly.exists?(request.params[:id]) } do resources :pages, only: :show, path: "/" end resources :posts, path: "(/:component_1(/:component_2(/:component_3)))/", only: :show, constraints: ->(request){ request.params[:component_1] != "assets" } resources :posts, only: nil do resources :comments, only: [:create, :destroy] end constraints ->(request){ !Storytime::Site.first } do get "/", to: "application#setup", as: :storytime_root # should only get here during app setup end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
storytime-1.0.2 | config/routes.rb |
storytime-1.0.1 | config/routes.rb |
storytime-1.0.0 | config/routes.rb |