There may be a subtlety that can help. When a controller renders a
page, it is that controller, its views, and its helpers which are in
play (plus application stuff, of course). There is an option to tell
a controller to delegate rendering of a particular model's data to
another controller. Perhaps these facts will avoid the kludge?
On Dec 4, 5:42 am, "G. Sobrinho" <[EMAIL PROTECTED]> wrote:
> This doesn't work if you have nested models...Stupid example:
>
> A belongs_to B
> B has_many A
>
> If you have two fields with same column_name, the helper will not work...
> You can "workaround" it using this check:
>
> def name_form_column record, input_name
> if record.class == A
> # for A model
> else
> # for B model
> end
> end
>
> If you have 3 models, you can use elsif to check also...
> I cant found another method to fix it
>
> Regards
>
> Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
> escreveu:
>
> > El Thursday 04 December 2008 10:52:45 mi escribió:
>
> >> I upgrade active scaffold for work with rails 2.2.2.
>
> >> I have the same 'column_name' for different controllers.
>
> >> One of this has a helper with #{column_name}_column defined.
>
> >> I noticed that this method is used for all the field with the same
> >> 'column_name' .
>
> >> Anyone know how is possible to avoid that?
>
> > Remove helper :all from application controller
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---