On Mon, May 5, 2008 at 5:19 PM, Arjan van Bentem
<[EMAIL PROTECTED]> wrote:
>
> > ar_lookup (field_name)
>
> Thanks! That certainly looks more like Ruby, if only for less braces ;-)
Well, now I'm wondering if it should be named ar_lookup, ext_lookup or
external_lookup might be better, it's not ActiveRecord limited. Your
choice.
> I assume I can figger out how to make dollar notation work as well:
>
> set :field => "customer", :val => [ "Customer", "find_by_name_and_city",
> "${f:name}", "${f:city}" ]
The thing is it will grab the ${f:xx} values when the 'set' is
executed, maybe you need something that reads the values when the
ext_lookup() is executed...
> So, I can surely use your code to build the custom form.
I haven't tested it ;)
> Next, I want to keep WorkItemController#update a bit generic, the I'd
> need to know what form field names to expect. For that, I guess I need
> to hardcode some name (in my case: I hardcoded the fieldname which
> refers to the class that knows how to find the data, and which has
> setters methods to set new values) -- unless someone has some better
> solution for that as well!
Your knowledge of Rails forms is vastly superior to mine, I'd be glad
to help, but you have to show the way :)
Maybe the find / lookup logic can be used once again, at update time,
to locate the ActiveRecord.
Cheers,
--
John Mettraux - http://jmettraux.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru users" 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/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---