Sha256: ee9be24ef29622001bbe870dc0a26016a0c9a5bba2cb78f6d6d2b44914185733

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

HomesteadingPublisher::Engine.routes.draw do
  
  resources :settings, only: [:index, :edit, :show, :update]

  get "/posts/new",
      to:          "posts#new",
      as:          "new_post"

  post "/posts",
      to:          "posts#create",
      as:          "posts"

  post "/posts/:year/:month/:day",
      to:          "posts#create",
      constraints: { year: /\d{4}/, month: /\d{1,2}/, day: /\d{1,2}/ }

  get "/posts/:year/:month/:day/:slug",
      to:          "posts#show",
      constraints: { year: /\d{4}/, month: /\d{1,2}/, day: /\d{1,2}/ },
      as:          "post"

  get "/posts/:year/:month/:day/:slug/edit",
      to:          "posts#edit",
      constraints: { year: /\d{4}/, month: /\d{1,2}/, day: /\d{1,2}/ },
      as:          "edit_post"

  patch "/posts/:year/:month/:day/:slug",
      to:          "posts#update",
      constraints: { year: /\d{4}/, month: /\d{1,2}/, day: /\d{1,2}/ }

  delete "/posts/:year/:month/:day/:slug",
      to:          "posts#destroy",
      constraints: { year: /\d{4}/, month: /\d{1,2}/, day: /\d{1,2}/ }

  # atom feed
  get "/posts/feed", to: "posts#index", defaults: { format: "atom" }, as: :feed

  # Pagination
  get "/posts/page/1",                    to: redirect("/")
  get "/posts/page",                      to: redirect("/")
  get "/posts/page/:page",                to: "posts#index"
  get "(/posts)(/:year)(/:month)(/:day)", to: "posts#index"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
homesteading_publisher-0.2.4 config/routes.rb
homesteading_publisher-0.2.3 config/routes.rb