Skip to content

Instantly share code, notes, and snippets.

@Virksaabnavjot
Created July 23, 2017 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Virksaabnavjot/4e87620b389039e020b46d34cf0507cf to your computer and use it in GitHub Desktop.
Save Virksaabnavjot/4e87620b389039e020b46d34cf0507cf to your computer and use it in GitHub Desktop.
Useful resources
Ruby on Rails Tutorial: Developing a Demonstration Application
https://www.youtube.com/watch?v=7Vj0u_q-iEw
@Virksaabnavjot
Copy link
Author

Ruby on Rails Tutorial: Developing a Demonstration Application
https://www.youtube.com/watch?v=7Vj0u_q-iEw

@Virksaabnavjot
Copy link
Author

Virksaabnavjot commented Jul 24, 2017

rails g scaffold Pat name:string dob:timestamp phone:integer condition:string appointment:datetime

<%= form_for(@shipment) do |f| %>

<%= f.label :from %><br>
<%= f.select :condtition, [ 'Undetermined ','Good','Fair','Serious','Crtitcal','Treated and Released','Confirming patient deaths' ], :prompt => 'Select One' %>

<%= f.submit %>

<% end %>

@Virksaabnavjot
Copy link
Author

Undetermined - Patient is awaiting physician and/or assessment.
Good - Vital signs are stable and within normal limits. Patient is conscious and comfortable. Indicators are excellent.
Fair - Vital signs are stable and within normal limits. Patient is conscious, but may be uncomfortable. Indicators are favorable.
Serious - Vital signs may be unstable and not within normal limits. Patient is acutely ill. Indicators are questionable.
Critical - Vital signs are unstable and not within normal limits. Patient may be unconscious. Indicators are unfavorable.
Treated and Released – This could mean the patient was sent home or to another facility.
Confirming patient deaths – We will report or confirm a patient’s death only after signed consent from next of kin.

@Virksaabnavjot
Copy link
Author

$ rake db:migrate

@Virksaabnavjot
Copy link
Author

Virksaabnavjot commented Jul 24, 2017

in apps/model/Pat.rb

class Pat < ActiveRecord::Base
validates :appointment, :uniqueness => { :message => "appointment already taken" }
validates :name, :presence => true
validates :dob, :presence => true
validates :condition, :presence => true

end

@Virksaabnavjot
Copy link
Author

Virksaabnavjot commented Jul 24, 2017

root 'pats#new'

@Virksaabnavjot
Copy link
Author

Virksaabnavjot commented Jul 24, 2017

Devise Steps
Open the �le development.rb from the con�g ! environments
config.action_mailer.default_url_options = { host: ENV['IP'],
port: ENV['PORT'] }

@Virksaabnavjot
Copy link
Author

doctors profile

rails g scaffold doctor firstname:string lastname:string address:string user:references phone:string

@Virksaabnavjot
Copy link
Author

@Virksaabnavjot
Copy link
Author

SQLite

log in by hitting rails dbconsole

.tables

PRAGMA table_info(doctors);

@Virksaabnavjot
Copy link
Author

Virksaabnavjot commented Jul 26, 2017

generating scaffold for the decorator

rails g scaffold Transfer firstname:string lastname:string firm:string cost:decimal detail:string age:integer

@Virksaabnavjot
Copy link
Author

for printing functionality

<%= link_to "Print", '#', class: "btn btn-primary", onclick: 'window.print();return false;' %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment