On Sábado, 2 de Octubre de 2010 21:22:15 thoen escribió:
> I have an active_scaffold form that contains two calendar_date_select
> columns:
>
> config.columns[:event_start].form_ui = :calendar_date_select
> config.columns[:event_end].form_ui = :calendar_date_select
>
> I would like to have the value selected from the event_start column to
> update the event_end column.
>
> config.columns[:event_start].update_column = :event_end
>
> However, when I change the value in the event_start, the event_end is
> being set to blank.
> In the ajax response, the input field does not appear to contain any
> value, thus setting the field to blank.
>
> Preferably, I would even be able to modify the event_start value
> before it is placed into event_end. I would like event_end to be 1
> hour greater than event_start.
>
> Is there something that I have not configured properly in order to get
> this to work?
Have you defined some helper override? Render field request only render it
again, but you must set a helper override to display something using
event_start value, or define after_render_field in your controller to set
event_end column:
def after_render_field(record, column)
if column.name == :event_start
record.event_end = record.event_start + 1.hour
end
end
>
> I am running rails 2.3.5. I am running the latest version of the af
> rails-2.3 branch (as of today).
>
> Any advice would be greatly appreciated.
>
> Tom
--
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.