Hi Hassan,

> > It can't be nil.  When the form is instantiated
>
> Assuredly, it can be -- a request can be generated without your form
> being involved at all.

I don't get it.  Can you point me to some tutorial that deals with
this issue?

> I'd suggest that it's good practice to handle any (even nil) input value
> in a way appropriate to your business logic.

I've code exactly the logic I wanted, except for how to enforce that a
vendor be selected from the drop-down before creating a new expense
record.  What I didn't realize was that the validation occurs just
before a database row is added,  so that the form's values could be
used for the validation.  That's what Ar's post led me to understand.

> Or not, your call. Don't take my word for it. Write a test and see what
> happens when you supply a nil value for that attribute. :-)

I appreciate your suggestion as a way to improve my understanding.
But the issue I was stuck on is solved now,  so I'm now rated to stick
ver. 1 of my app on website hosting service.

Best wishes,
Richard

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

Reply via email to