Purpose of "consider_all_requests_local" in config/environments/development.rb?

Ruby on-RailsRuby

Ruby on-Rails Problem Overview


What is the purpose of this Rails config setting...

config.action_controller.consider_all_requests_local = true

It's set to true by default in config/environments/development.rb.

Thanks,

Ethan

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

Non-local requests result in user-friendly error pages. Local requests, assumed to come from developers, see a more useful error message that includes line numbers and a backtrace. consider_all_requests_local allows your app to display these developer-friendly messages even when the machine making the request is remote.

Solution 2 - Ruby on-Rails

At development level we set:

> consider_all_requests_local set = true

because developer needs to take a look at full error showing layout/view as you can see in the image below.

enter image description here

But at production level, we don't need to show our internal coding bug so we set false:

> config.consider_all_requests_local = false

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEthanView Question on Stackoverflow
Solution 1 - Ruby on-RailsGordon WilsonView Answer on Stackoverflow
Solution 2 - Ruby on-RailsTouseef MurtazaView Answer on Stackoverflow