I'm using LockDown and it instantiates each controller to setup
security. Since I have many ActiveScaffold controllers this
instantiation takes a long time because AS needs to make a db query
for each controller's model. Is there a way to delay calling the
active_scaffold method, e.g., in a before_filter, rather than having
it at the class level in the controller.rb file? For example, I've
tried the following and it doesn't seem to work. Any other
suggestions for how to avoid the active_scaffold db query until an
actual request arrives?
class SomeController < ApplicationController
layout 'admin'
def lazy_init_active_scaffold
self.class.active_scaffold :some_model do |config|
config.label = 'label...'
...
end
before_filter :update_table_config
def update_table_config
lazy_init_active_scaffold
...
end
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.