ruby - How to define model relationships for this Rails app for physiotherapists? -


I am trying to make my first real life rail app, I'm a Ruby on Rail.

The idea is as follows:

The app shows an overview of practice . Each exercise has a category: string, bodypart: string, instructions: text and An image (this will add using the paperclip gem). Then there is Patient name of each patient: String and Email: String Finally Exercise Plans There is a name in each exercise plan: String and observation of exercises in it.

As an user of the app (physiotherapist) I can choose exercise from observation and can email them to a patient. When selecting a PDF form (prone to gem using it), the user (physiotherapist) should be able to record 'repetition' or 'per exercise' per exercise. It should be added to the exercise plan and should be printed in PDF.

How can I define ideal organizations in ActiveRecord?

I would start with something like this:

  class Exercise & lt; ActiveRecord :: Base is_im: exercise_plan and class patient & lt; ActiveRecord :: Base has_many: exercise_plans # or maybe just `is_on`? End Class Exercise Plan & lt; ActiveRecord :: Base is_to: Patient has_and_belongs_to_many: End of practice   

You will need db: exercise , patient , Exercise_planan , exercise_plans_exercises . In the end, only the references of exercise_plan_id and exercise_id are needed by holding collaboration between schemes and practices.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -