Sergio Cambra .:: entreCables S.L. ::. wrote:
> I think the best way it's to add an method, add_active_scaffold_path,
> to add view paths. All paths added by plugins usually should go
> between active_scaffold_overrides and active_scaffold_frontends, so it
> will be enough with that method most time.
Whilst that works for me and my needs, it occurs to me that someone
might want to create a plugin which overrides some builtin AS
functionality. In that case it might be helpful to insert the paths
before the AS paths? Or perhaps some enterprising person wants to do
something equally clever and override the paths using a before filter or
whatever
Seems to me that if the code were changed as follows:
module ClassMethods
def active_scaffold(model_id = nil, &block)
.. # define as paths
..
@active_scaffold_paths ||=
ActionView::PathSet.new(@active_scaffold_overrides +
@active_scaffold_frontends) unless @active_scaffold_overrides.nil? ||
@active_scaffold_frontends.nil?
..
end
def active_scaffold_paths
@active_scaffold_paths
end
def active_scaffold_paths=(new_path
@active_scaffold_paths = new_path
end
Then this would be more flexible and suit all needs?
Should also make it easier to be introspective about the paths currently
set if that were needed in some code.
What do you think?
Ed W
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---