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

  • Home
  • SEARCH
  • 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 9240447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:11:30+00:00 2026-06-18T08:11:30+00:00

Title says it all. Note that this is not about a change in the

  • 0

Title says it all.

Note that this is not about a change in the model or initializers.
I can delete an instance variable in the controller (say, @user) and then reload a view and it will work – until I restart the server, in which case it will complain about the variable being nil.

I was working normally and then switched to work on a totally different set of controllers and views and now it’s happening for no reason whatsoever.

The app is in a development environment.

development.rb contents:

Dashboard::Application.configure do
  config.cache_classes = false
  config.whiny_nils = true
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.action_mailer.raise_delivery_errors = false
  config.active_support.deprecation = :log
  config.action_dispatch.best_standards_support = :builtin
  config.assets.compress = false
  config.assets.debug = true
end

How can I find out how it’s happening and how do I fix it?

Edit:
**It’s likely related, but I can’t seem to use any paths that exist when running ‘rake routes’ in a partial, such as dashboards_path**

Plot twist:
Adding

config.reload_classes_only_on_change = false

to development.rb seemed to have ameliorated the issue. I still would like to know why it happened, why it happened out of the blue and why it happened to one controller but not the other.

  • 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-06-18T08:11:31+00:00Added an answer on June 18, 2026 at 8:11 am

    Rails uses the autoload paths config to determine what files to auto load, and reload:

    module YourApp
      class Application < Rails::Application
        config.autoload_paths += %W( #{config.root}/lib #{config.root}/lib/**/ #{config.root}/app/traits )
    
        ...
    
      end
    end
    

    As you can see I have added a custom directory, the app/traits directory, where I store some modules that define shared behavior.

    If the controller you started working on is in a subdirectory that is not watched by rails or has permissions that stop rails from attaching a file system changed event you get this problem.

    The reason that config.reload_classes_only_on_change = false “solves” the problem is that the entire app is reloaded on every request instead of relying on detecting changes to files.

    Most likely the controller is not in the watched files list and thats why rails is not reloading it on change. The exact reason why it’s not on the list might vary and I need more details about the folder structure and config of the app before I can give a good answer there…

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

Sidebar

Related Questions

The title basically says it all. I mainly want to do this so that
The title basically says it all. I'm aware this can't be done using traditional
Title says all. I'll have navigation that looks like this and it's dynamically created
As the title says, I'm trying to change the ID of all elements with
Basicaly title says it all, mine file looks like this: edit Product,Home > Opto-electronics
Title basically says it all. This is my script: keepProgramRunning = True a =
The title sort of says it all. I have a text file (NOT a
Title pretty much says it all. I am developing for a client that serves
The title pretty much says it all. I have a regex that I need
Title basically says it all. The error I get at: document.forms[0].onsubmit = validateForm; This

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.