E
E
eldar_web2015-04-08 11:45:20
Ruby on Rails
eldar_web, 2015-04-08 11:45:20

How to redirect to 404 (automatically) in Ruby-on-Rails if such page does not exist?

Here is a link to an example groupp.ru/products/ochistnye_sooruzheniya/livnevay... - this is a real page. And if we add anything to the end of the url (for example , groupp.ru/products/ochistnye_sooruzheniya/livnevay... then it will still show this page.
How can I redirect to the 404 page automatically if such a page does not exist ???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Vsk, 2015-04-08
@viktorvsk

How bad things are going for you, apparently...
simonecarletti.com/blog/2009/12/inside-ruby-on-rai...
This is how to redirect errors
But you most likely have a path in the router like
AND *permalink "eats" all the paths, no matter what they write
But how this happens - it already depends on how it is implemented

E
Evgeny Tkachenko, 2015-04-08
@eugene20tkachenko

I have the impression that there are some rules for fallbacks, because no matter how incorrectly the address was written, redirect to some page according to the structure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question