Changes to erb files not being noticed by server

I am new to Rails.

I run Rails with ruby script/server then the code in my index.html.erb
displays in the browser as expected.

If I change the contents of index.html.erb file and reload the page from
the browser the changes do not appear.

If I restart the server the changes still do not appear.

If I wait for say 5 minutes then the changes may appear.

If I look in the development log the original page contents are
requested but not the one with my changes. It is as if the server does
not notice I have made a change.

I thought it might be the browser. But even if I try a different browser
the original page is displayed.

I have tried using mongrel and webrick but both have the same problem.

Also it is just the html.erb files. If I change the contents of a
variable in a controller rb file the new value appears straight away in
the browser when I reload.

Is there a setting maybe I need to change to force the server to pick up
my html changes?

Thanks

Roy

Did you run server in production environment? Is the any page, action
or fragment caching?

Although my guess would be your browser cache. Have you tried browsing
with cache disable? Web developer plugin for Firefox could easily
disable cache

Cheers!
Arzumy

On Aug 23, 11:01 am, Roy B. [email protected]

Arzumy wrote:

Did you run server in production environment? Is the any page, action
or fragment caching?

I am assuming I am running in development mode as the development log is
being filled by the server.

If I use reload I thought the browser would request the page again from
the server, which it does according to the development log. The server
manages to find the index.html.erb page even after I have deleted the
page from the view folder.

It appears as though the server is caching the page. Which implies it is
in production mode.

2009/8/23 Roy B. [email protected]:

manages to find the index.html.erb page even after I have deleted the
page from the view folder.

It appears as though the server is caching the page. Which implies it is
in production mode.

Have you accidentally (or on purpose) changed any settings in
confg/environments/development.rb?
In particular check
config.cache_classes = false
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false

Colin

Hi Colin

I left everything as defaults, I have only used rails to go through some
tutorials and my first example application.

I did try using the Eclipse add on for Ruby but I could not get the
plugin to load. I then tried NetBeans IDE before deciding a simple text
editor was better as a newbie. I wonder if either of these might have
added something.

I think my next choice is to un-install Ruby and start again from
scratch.

Thanks

2009/8/24 pharrington [email protected]:

editor was better as a newbie. I wonder if either of these might have
Probably a dumb question, but have you checked to make sure there
weren’t actually "duplicate’ files in the view directory? For example,
does anything like both “index.html.erb” and “index.html.erb.swp”
exist in app/views/whatever ?

Good point, .bak files have also been known to cause problems.

Colin

Good point, .bak files have also been known to cause problems.

I am using Ultraedit as my text editor which leaves behind a .bak file.

If I delete the bak file before reloading the browser then the updates I
made appear on the screen immediately.

It was interesting, after I deleted the .bak and reloaded the browser,
Rails complained the view file had disappeared. On hitting the reload
button a second time the real erb file with the changes was displayed by
the browser. Rails preferred the .bak file to the erb file.

I am sure I used Ultraedit to edit files elsewhere without the .bak
problem getting in the way. It was also recommended as an editor for
Rails in Simply Rails 2 by Patrick Lenz

I now just have to work out if I need to change editor or if there is a
way to fix the leaving of .bak files behind.

Thanks for shedding light on this curious and infuriating problem.

Cheers,

Roy

On Aug 23, 7:46 pm, Roy B. [email protected]
wrote:

I think my next choice is to un-install Ruby and start again from
scratch.

Thanks


Posted viahttp://www.ruby-forum.com/.

Probably a dumb question, but have you checked to make sure there
weren’t actually "duplicate’ files in the view directory? For example,
does anything like both “index.html.erb” and “index.html.erb.swp”
exist in app/views/whatever ?

I have just been through the Ultraedit help and found there are several
options available for using the .bak file.

Thanks once again.

Roy

I am running Rails 2.3.2.

Cheers,

Roy

2009/8/25 Roy B. [email protected]:

Rails complained the view file had disappeared. On hitting the reload
way to fix the leaving of .bak files behind.

This was a bug in Rails at some version (not sure which), it was fixed
by 2.3.2 or possibly earlier I think. Which version are you using?

Colin

2009/8/26 Roy B. [email protected]:

I am running Rails 2.3.2.

Maybe it was 2.3.3 it was fixed in then, or maybe I am talking rubbish.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs