I have a model with two entities (document and asset) and a 1:1
relationship defined between them (every model has an asset).
I want to generate a rthml view that generates a hash for document
attributes and a nested hash for asset attributes (for example
{:document =>{:name=>XXX :asset => {date =>XXX}})
According to the Pragmatic Programmers book (page 355), the input fields
for this should be something like
The question is: how can i generate the second field with the rails
helpers. I have tried:
-----Mensaje original-----
De: [email protected]
[mailto:[email protected]] En nombre de Mark Reginald
James
Enviado el: sábado, 03 de diciembre de 2005 15:14
Para: [email protected]
Asunto: [Rails] Re: View helpers and nested attributes
Rubén Gil wrote:
I have a model with two entities (document and asset) and a 1:1
relationship defined between them (every model has an asset).
I want to generate a rthml view that generates a hash for document
attributes and a nested hash for asset attributes (for example
{:document =>{:name=>XXX :asset => {date =>XXX}})
According to the Pragmatic Programmers book (page 355), the input
fields
Is it possible to generate this kind of nested fields with helpers or
should I generated by hand?
Three options:
Manual HTML
The text_field_tag helper, overriding the id tag if necessary