Peter Ertl
2006-Apr-29 10:17 UTC
[Rails] reloading include-modules inside controller not working
Hi guys,
I would expect an ActionController-derived class to reload _completely_ in
development mode.
class FooController < ApplicationController
include FancyStuffSupport
def index
# bla
end
# more actions here
end
However, the ''FancyStuffSupport'' is not reloaded, only the
''FooController''
itself. Can this behaviour be changed? I feel back in Java when I have to
restart the server for every tiny change :-(
Any help appreciated :-)
Best Regards
Peter
Philip Ross
2006-Apr-29 14:22 UTC
[Rails] Re: reloading include-modules inside controller not working
Peter Ertl wrote:> I would expect an ActionController-derived class to reload _completely_ in > development mode. > > class FooController < ApplicationController > include FancyStuffSupport > end > > However, the ''FancyStuffSupport'' is not reloaded, only the ''FooController'' > itself. Can this behaviour be changed? I feel back in Java when I have to > restart the server for every tiny change :-(Add a require_dependency ''fancy_stuff_support'' to your controller file. This will cause a reload on each request. See http://wiki.rubyonrails.com/rails/pages/RequireDependency for more details. -- Philip Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby