Hi,
options_for_association_conditions allows to constrain the option list
by an SQL fragment.
Can I access the actual record that is being updated, to allow to make
the options presented
depend on some property of the current record ?
I am implementing a problem tracker and to support the workflow, the
drop-down options
for the problem status should depend on the current status of the
problem. It should not be
allowed to move from "new" to "fixed" without having seen "analyzed".
Here's the problem in code (in the helper):
def options_for_association_conditions(association)
if association.name == :problemstatus
#
# How do I access the problem itself here ?
# There is only access to the association.
#
else
super
end
end
I tried to use the construction "association.active_record" somehow,
but this seems not to allow
access to the underlying record.
Thanks in advance,
Chris
--
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.