-1

Simple Question: I want to redirect or change the "Routing Error" page so the user cannot see all the routes. (*Not 404, etc)

I'm not sure if this will go away once it is in production, but I didn't see anyone talking about this page specifically.. Nothing is broken, I just don't want to show the Routes page incase a user session ends.

Thanks SO

What I have done: Stackoverflow has question/answer for changing a 404 page etc which I have done.

It also has posts about routes that don't work which isn't my problem. All routes work.

I have tried to research modifying the ActionController::RoutingError and that is why I came here

Mason SB
  • 445
  • 1
  • 3
  • 13
  • Please read "[ask]" and its linked pages. Did you research this? Where? If it didn't help tell us why. What did you try? If you didn't try, why not? If you did, what did you do? We'd like to see your minimal attempt to solve it. – the Tin Man Jun 07 '20 at 05:16
  • The routing error page you see by default during development will include much more information than you would see in production. There, you usually only see a generic 404 error page. You can check this yourself by starting your app with `RAILS_ENV=production rails server` (make sure to configure your database appropriately for production too). – Holger Just Jun 07 '20 at 11:58
  • @theTinMan yes I did research just didn't post the links. I found things on changing a 404,500,etc view which I already did. I also looked over the ruby on rails docs. I also looked over multiple posts on stackoverflow which didnt address my question. – Mason SB Jun 07 '20 at 14:39
  • @HolgerJust THANK YOU FOR ANSWERING MY QUESTION. – Mason SB Jun 07 '20 at 14:49

1 Answers1

1

The routing error page you see by default during development will include much more information than you would see in production. There, you usually only see a generic 404 error page. You can check this yourself by starting your app with

RAILS_ENV=production rails server

Make sure to configure your database appropriately for production too. If you want to setup custom handling for routing errors in production, e.g. to render a specific page), please refer to the answer on rescue_from ActionController::RoutingError in Rails 4.

Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • Thank you so much for the answer. I have the site up on an apache server and have it running off of dev vs production. – Mason SB Jun 07 '20 at 23:02