On Domingo, 6 de Diciembre de 2009 21:32:44 ruinen escribió:
> In the end, I think I've found my own solution. I need to make these
> changes in a subform, so I took a copy of
> _horizontal_subform_header.html.erb from Vendor/plugins/
> active_scaffold/frontends/default/views and placed it in views folder
> of my controller.
>
> I left the HTML of this erb unchanged and just added at the top my
> script ...
>
You can use <%= render :super %> instead of copy the html. Sometimes you will
need to pass parameters in :locals option, as the view which render
_horizontal_subform_header.html.erb. Probably:
<%= render :super, :locals => {:parent_record => parent_record} %>
> <script type="text/javascript">
> document.observe('dom:loaded', function() { //do it once everything's
> loaded
> //grab all the product-input classes and call 'observe' on them :
> $$('.product-input').invoke('observe', 'change', function(e) {
> this.up('td').next('td').down('input').hide();
> });
> });
> </script>
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E)
ser...@entrecables.com