On Viernes, 31 de Julio de 2009 17:03:20 Nick Rogers escribió: > try... > > ActiveScaffold::DataStructures::ActionColumns.class_eval do > def test > end > end
This is the right way, although usually is recommended to use a module and include it: module ActionColumnsExtension def test end end ActiveScaffold::DataStructures::ActionColumns.class_eval do include ActionColumnsExtension end http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html > > On Fri, Jul 31, 2009 at 7:09 AM, Kenny Ortmann <[email protected]>wrote: > > I do not know the answer to your question, but what are you trying to > > add? > > > > > > On Fri, Jul 31, 2009 at 9:04 AM, [email protected] < > > > > [email protected]> wrote: > >> Hi, > >> > >> I ve got quite a basic question. > >> > >> Let s assume I would like to add a new method to an activescaffold > >> class eg action_columns.rb > >> I m trying to avoid changing the file itself... > >> > >> How should I do that? > >> > >> Ive tried to do it via an extension file, which is required in > >> application_controller: > >> module ActiveScaffold::DataStructures > >> class ActionColumns > >> def test > >> end > >> end > >> end > >> > >> However, that has the negative effect, that AS File never gets loaded, > >> which is bad... > >> > >> Thanks a lot in advance.. > >> Volker > > -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
