From 929d6e7ec578531dc1d6c6369e5e4fd176923ffd Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 30 Aug 2016 14:42:01 -0700 Subject: [PATCH] add glob patten for missing routes --- app/controllers/static_controller.rb | 4 ++++ config/routes.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 10152eae6..328777124 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -8,6 +8,10 @@ class StaticController < ApplicationController redirect_to(url || posts_path) end + def not_found + render text: "not found", status: :not_found + end + def error end end diff --git a/config/routes.rb b/config/routes.rb index efa0fea34..20bb7bf10 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -420,4 +420,6 @@ Rails.application.routes.draw do get "/intro" => redirect("/explore/posts/intro") root :to => "posts#index" + + get "*other", :to => "static#not_found" end