the weird thing is that if i fill out the entire form,
it’ll show no problems?
any idea to this weird problem?
If the problem is the create action, it would make sense to show us
the code for the create action, not the new action. My guess is that
in your create action you are following the standard pattern of
rerendering the new template if validation fails. However, in your
create action you don’t initialize @measurement_formats, hence the
error.
On Sun, Jun 15, 2008 at 5:47 AM, Frederick C. < [email protected]> wrote:
in your create action you are following the standard pattern of
rerendering the new template if validation fails. However, in your
create action you don’t initialize @measurement_formats, hence the
error.
And, since the nil.each might be a mystery to a nuby, let me point out
that:
for measurement_formats in @measurement_formats
#…
end
is just Ruby syntactic sugar for
@measurement_formats.each do | measurement_formats |
#…
end
BTW I’d suggest renaming the local measurement_formats (without the @)
to
measurement_format in either case, since it’s going to be a single
measurement_format at any given time.