Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
Rails controller caching when using docker container (dev)

I have docker running an app container (rails app) and a db container running postgres

I have volume mounted my local working directory to my app container so I can work locally and the changes reflected in the app container.

In doing this everything seems to work fine except I seem to get some strange caching behaviour on my controllers

for example

route:

get '/something', to: 'something#show'

controller

class SomethingController < ApplicationController
    def show
        render text: "Hello 1"
    end
end

When I go to myapp/something I get Hello 1 perfect!

Then I edit my controller to:

class SomethingController < ApplicationController
    def show
        render text: "Hello 2"
    end
end

When I go to myapp/something I still get Hello 1?

If I return a html view, it updates just fine, so why is my changes in my controller not being reflected?

The only way I can get these changes to reflect is by making a change in my routes file and saving, this seems to refresh whatever is being cached.

note: I am not caching in the browser, I have caching turned off and Im doing a hard reload each time.

Can anyone shed any light on this? Im trying to follow this tutorial: https://www.youtube.com/watch?v=NEdDa3Zqu7s&list=PLbG4OyfwIxjEe5Y3hQCiQjYnSgRH051iJ&index=3

Thanks

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

How did you define your development.rb?

Make sure you have the caching options set to false:

config.reload_classes_only_on_change = false
config.cache_classes = false

If this doesn't work you might want to read the Rails docs about caching: http://guides.rubyonrails.org/caching_with_rails.html

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda