Forum: Ruby on Rails Problem with STI and validation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ChrisT (Guest)
on 2006-03-16 18:53
(Received via mailing list)
OK. Here's another one on STI (thanks for the help of all of you with my
previous STI question, and I promise to update the wiki with the info).
I'm having a prob with validation with the sub-classes. It's a bit
long-winded to explain, but I'll post all the logs and code if there's
no obvious answers. Basically, however, I have validation on the main
model (Person, presence of :name). This works no prob, sending you back
to the form with the usual error and fields all filled in.

However for the subclass, Manager, it chucks you back to the form, but
without an error (not even anything in the log), and without the fields
pre-populated. I'll try a few more experiments to see if I come up with
more useful info but wondered if anyone else had experienced anything
similar, and could identify the prob.

Thanks in advance,
Chris T
Chris T (Guest)
on 2006-03-16 19:48
Sorry!. Please ignore this. My bad. Stupid error with render.
Chris T
ChrisT wrote:
> OK. Here's another one on STI (thanks for the help of all of you with my
> previous STI question, and I promise to update the wiki with the info).
> I'm having a prob with validation with the sub-classes. It's a bit
> long-winded to explain, but I'll post all the logs and code if there's
> no obvious answers. Basically, however, I have validation on the main
> model (Person, presence of :name). This works no prob, sending you back
> to the form with the usual error and fields all filled in.
>
> However for the subclass, Manager, it chucks you back to the form, but
> without an error (not even anything in the log), and without the fields
> pre-populated. I'll try a few more experiments to see if I come up with
> more useful info but wondered if anyone else had experienced anything
> similar, and could identify the prob.
>
> Thanks in advance,
> Chris T
This topic is locked and can not be replied to.