Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haslinger/7931286 to your computer and use it in GitHub Desktop.
Save haslinger/7931286 to your computer and use it in GitHub Desktop.

Hobo can even create an autocompletion for relations from the has_many side of a relation.

<!-- I live in app/views/taglibs/admin/product.dryml -->
<extend tag="form" for="Product">
<old-form merge multipart>
<field-list: fields="name_de, name_en, number, description_de, description_en, categories,
property_groups, recommendations, productrelations, supplyrelations,
document, photo" param>
<productrelations-view:>
<input-many>
<field-list fields="related_product" size="5">
<related-product-label: replace/>
<related-product-view:>
<name-one complete-target="&@related_product" completer="name_admin" autocomplete="off" />
</related-product-view:>
</field-list>
</input-many>
</productrelations-view:>
<recommendations-view:>
<input-many>
<field-list fields="recommended_product" size="5">
<recommended-product-label: replace/>
<recommended-product-view:>
<name-one complete-target="&@recommended_product" completer="name_admin" autocomplete="off"/>
<input with="&this_parent" field="reason_de" class="span2"/>
</recommended-product-view:>
</field-list>
</input-many>
</recommendations-view:>
<supplyrelations-view:>
<input-many>
<field-list fields="supply" size="5">
<supply-label: replace/>
<supply-view:>
<name-one complete-target="&@supplied_product" completer="name_admin" autocomplete="off"/>
</supply-view:>
</field-list>
</input-many>
</supplyrelations-view:>
</field-list:>
</old-form>
</extend>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment