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.
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?
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.
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.
This is common and typically due to the validation failure handling of
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