subgrouping forms, another question

8 views
Skip to first unread message

Atastor

unread,
Nov 15, 2011, 3:38:32 AM11/15/11
to actives...@googlegroups.com
Do I really have to configure two different sets of subgroups for create and update, each? Or is there a way to DRY this up?

Regards
Michael

Sergio Cambra .:: entreCables S.L. ::.

unread,
Nov 15, 2011, 7:23:45 AM11/15/11
to actives...@googlegroups.com
On Martes, 15 de Noviembre de 2011 09:38:32 Atastor escribió:
> Do I really have to configure two different sets of subgroups for create
> and update, each? Or is there a way to DRY this up?
>

Yes, but you can use a loop:

[:create, :update].each do |action|
conf.send(action).columns.add_subgroup ...
end

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Atastor

unread,
Nov 15, 2011, 8:59:11 AM11/15/11
to actives...@googlegroups.com
Ah, ok, the send does the trick; paying attention to the difference of symbols and messages might have helped here...

Thanks once more!
Michael

Reply all
Reply to author
Forward
Message has been deleted
0 new messages