class ActionDispatch::Routing::Mapper
Public Instance Methods
comfy_route_blog(options = {})
click to toggle source
# File lib/comfy_blog/routes/blog.rb, line 5 def comfy_route_blog(options = {}) ComfyBlog.configuration.public_blog_path = options[:path] || "blog" path = ["(:cms_path)", ComfyBlog.configuration.public_blog_path].join("/") scope module: :comfy, as: :comfy do namespace :blog, path: path do with_options constraints: { year: %r{\d{4}}, month: %r{\d{1,2}} } do |o| o.get ":year", to: "posts#index", as: :posts_of_year o.get ":year/:month", to: "posts#index", as: :posts_of_month o.get ":year/:month/:slug", to: "posts#show", as: :post o.get "/", to: "posts#index", as: :posts end end end end
comfy_route_blog_admin(options = {})
click to toggle source
# File lib/comfy_blog/routes/blog_admin.rb, line 5 def comfy_route_blog_admin(options = {}) options[:path] ||= "admin" path = [options[:path], "sites", ":site_id"].join("/") scope module: :comfy, as: :comfy do scope module: :admin do namespace :blog, as: :admin, path: path, except: [:show] do resources :posts, as: :blog_posts, path: "blog-posts" do get :form_fragments, on: :member resources :revisions, only: %i[index show], controller: "revisions/post" do patch :revert, on: :member end end end end end end