On Martes, 8 de Diciembre de 2009 18:00:26 Victor escribió:
> I have a Purchase model. It has_many purchase_items. In my
> activescaffold, purchase_items is a subform in purchases. Both
> purchases and purchase_items have a :note field. How do I create a
> helper method to modify only the :note field for purchases and not
> modify the :note field for purchase_items?

You will have to check record.class and use input method when class is not 
Purchase:

def note_form_column(record, input_name)
        case record
                when Purchase
                        your_custom_field
                else
                        input(:record, :note, :name => input_name)
        end
end

Also, you can define in your helpers an active_scaffold form_ui and set it for 
note field in purchases.

>
> --
>
> You received this message because you are subscribed to the Google Groups
> "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

--

You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.


Reply via email to