paneq / active_reload

Reload Rails code in development mode only when change is deteced
Other
371 stars 12 forks source link

activeadmin #3

Closed rafaelss closed 12 years ago

rafaelss commented 13 years ago

active_reload doesn't work with activeadmin, the menu is not rendered anymore after the first request

paneq commented 13 years ago

Can you provide a demo app to demonstrate the issue ? I've never used activeadmin so I don't even know where to start. Something really simple would be great.

steverandy commented 13 years ago

I think active_reload have bug when loading a Rails Engine. I have an issue where a helper could not be found when I access the rails engine within the parent app.

paneq commented 13 years ago

I can confirmed that " the menu is not rendered anymore after the first request". I'm investigating this now.

paneq commented 13 years ago
      # Don't eagerload our configs, we'll deal with them ourselves
      Rails.application.config.eager_load_paths = Rails.application.config.eager_load_paths.reject do |path| 
        load_paths.include?(path)
      end

      # Dispatch request which gets triggered once in production
      # and on every require in development mode
      ActionDispatch::Callbacks.to_prepare :active_admin do
        ActiveAdmin.unload!
        Rails.application.reload_routes!
      end

    # Removes all the controllers that were defined by registering
    # resources for administration.
    #
    # We remove them, then load them on each request in development
    # to allow for changes without having to restart the server.
    def unload!
      namespaces.values.each{|namespace| namespace.unload! }
      self.namespaces = {}
      @@loaded = false
    end
paneq commented 13 years ago

This is hard...

paneq commented 12 years ago

I am closing all issues since I no longer maintain this gem and it was incorporated into Rails 3.2.