Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 511279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:12:01+00:00 2026-05-13T07:12:01+00:00

I’m trying to work out why when working on a 404 page on a

  • 0

I’m trying to work out why when working on a 404 page on a rails app I’m working, the only way to see changes I’ve made to the html on the page is to physically restart the webserver with a ctrl-C followed by a call to script/server.

As far as I can tell, I can’t see anything particularly wrong with the development.rb config file here:

# Settings specified here will take precedence over those in config/environment.rb

# In the development environment your application's code is reloaded on
# every request.  This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs                         = true
config.action_controller.perform_caching             = false

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = false

# add rack bug
# config.middleware.use "Rack::Bug"

#  this disables the caching for comatose, not the rest of the app
#  config.disable_caching = true

config.action_mailer.default_url_options = { :host => "localhost:3000" }

config.gem "thoughtbot-factory_girl",
             :lib    => "factory_girl",
             :source => "http://gems.github.com"

This alone won’t display the error pages locally, so in application_controller.rb I’ve aliased rescue_action_locally to the rescue_action_in_public method, to stop me seeing the stacktrace:

 #  this method allows you to test 404 and 500 pages locally
 alias_method :rescue_action_locally, :rescue_action_in_public

This here shows me the error page once, but then caches it so that future reloads show the state of the html file when the server was loaded.

The log output doesn’t show me any weird caching behaviour – it’s getting a request for a non-existent resource, not finding anything, then rendering the html page as required:

  chrisadams@r220-101-174-100 ~/RailsApps/annoying_app > script/server --debugger
  => Booting Mongrel
  => Rails 2.3.2 application starting on http://0.0.0.0:3000
  => Debugger enabled
  => Call with -d to detach
  => Ctrl-C to shutdown server
    SQL (0.2ms)   SET SQL_AUTO_IS_NULL=0

  Processing ApplicationController#index (for 127.0.0.1 at 2009-12-28 19:23:27) [GET]

  ActionController::RoutingError (No route matches "/non-existent-resource" with {:method=>:get}):

  Rendering /Users/chrisadams/RailsApps/annoying_app/public/404.html (404 Not Found)

The 404.html is totally static, without any ERB in there at all, and this static html page is what isn’t changing between page refreshes.

What am I doing wrong here? This is driving me crazy!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:12:01+00:00Added an answer on May 13, 2026 at 7:12 am

    I’ve noticed that not everything is reloaded on every request, even in development mode. Is your 404.html page completely static, or are you running it through ERB or something?

    rescue_from is also becoming the generally preferred means of doing this nowadays.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.