I'm currently experimenting with moving functionality into engines. It works nicely so far, but I'm a bit confused why certain parts of the engine are always automatically reloaded when something changed, and some are not.
Specifically, when adding a helper method, I have to restart the Rails server, otherwise it is not seen by Rails. Is this normal behavior? Here's the relevant part of my engine:
components/iq_list.rb
# encoding: utf-8
require 'iq_list/engine'
# Load IqList Modules
module IqList
extend ActiveSupport::Autoload
autoload :Helpers
autoload :Models
autoload :Controllers
end
components/iq_list/engine.rb
module IqList
class Engine < ::Rails::Engine
end
end
components/iq_list/helpers.rb
module IqList
module Helpers
extend ActiveSupport::Autoload
autoload :IqListHelper
end
end
components/iq_list/helpers/iq_list_helper.rb
module IqList
module Helpers
module IqListHelper
def some_method
# ...
end
end
end
end
I'm still very new to engines, and a lot of the code above I have taken from somebody else's work, so please be patient with me. Any hint into the right direction is highly appreciated.