David Kimura PRO said over 6 years ago on Single Table Inheritance :

Absolutely. However, I was illustrating the point of how the different classes would act. However, since the Emergency and Friend inherit from Contact, any common duplication would best live in Contact.


MANISH ANAND said over 6 years ago on Single Table Inheritance :

Hi,

While creating new emergencies the url is: http://localhost:3000/users/17/emergencies/new

If validation fails, the url is getting change as: http://localhost:3000/users/17/emergencies

And, than If i refresh the page, its getting crash, because its trying to find list of contacts.

So, how I can I fix this. Please help. 



David Kimura PRO said over 6 years ago on Single Table Inheritance :

This is common and typically due to the validation failure handling of 

render :new

Have a look at https://stackoverflow.com/a/41520362/722274

One way around this is to do client side validations which I have an example of this at https://www.driftingruby.com/episodes/client-side-validations


jacoby PRO said almost 5 years ago on Single Table Inheritance :
I'm building an application where I want to store various types of video. Each video type is a class that inherits from Video. How would I set up the private methods in controller? set_video, set_type, video_params?

Login to Comment