Skip to content

Instantly share code, notes, and snippets.

@rthbound
Created November 28, 2012 17:38
Show Gist options
  • Save rthbound/4162766 to your computer and use it in GitHub Desktop.
Save rthbound/4162766 to your computer and use it in GitHub Desktop.
def edit
@patient = PatientManager::Patient.find_by_id(params[:id])
Deface::Override.new(virtual_path: "patient_manager/patients/_form",
name: 'add-iburb',
insert_before: "div.form-actions",
text: "<%= f.label :email %><%= f.email_field :email %>")
end
form_for @patient do |f| %> f.label :number %> f.text_field :number %> f.label :first_name %> f.text_field :first_name %> f.label :last_name %> f.text_field :last_name %> f.label :date_of_birth %> f.date_select :date_of_birth %> f.label :gender %> f.select :gender, options_for_select(%w(Male Female), @patient.gender) %> f.label :ethnicity %> f.select :ethnicity, options_for_select(PatientManager::Constants::ETHNICITIES, @patient.ethnicity)%> f.label :address_one, 'Address' %> f.text_field :address_one %>
f.text_field :address_two %> f.label :city %> f.text_field :city %> f.label :state %> f.select :state, options_for_select(PatientManager::Constants::STATES, @patient.state) %> ` f.label :zip %> f.text_field :zip %> f.label :home_phone %> f.text_field :home_phone %> f.label :work_phone %> f.text_field :work_phone %> f.label :cell_phone %> f.text_field :cell_phone %> f.label :email %> f.email_field :email %> f.label :organization_id %> f.select :organization_id, options_from_collection_for_select(PatientManager::Organization.all, :id, :name, @patient.organization_id) %> f.fields_for :documents, PatientManager::Document.new do |d| %> d.label :document %> d.file_field :document %> end %> f.fields_for :notes, PatientManager::Note.new do |n| %> n.label :content, 'Note' %> n.text_area :content %> end %> f.label :email %> f.email_field :email %>
f.submit %>
end %>
<%= form_for @patient do |f| %>
<%= f.label :number %>
<%= f.text_field :number %>
<%= f.label :first_name %>
<%= f.text_field :first_name %>
<%= f.label :last_name %>
<%= f.text_field :last_name %>
<%= f.label :date_of_birth %>
<%= f.date_select :date_of_birth %>
<%= f.label :gender %>
<%= f.select :gender, options_for_select(%w(Male Female), @patient.gender) %>
<%= f.label :ethnicity %>
<%= f.select :ethnicity, options_for_select(PatientManager::Constants::ETHNICITIES, @patient.ethnicity)%>
<%= f.label :address_one, 'Address' %>
<%= f.text_field :address_one %><br />
<%= f.text_field :address_two %>
<%= f.label :city %>
<%= f.text_field :city %>
<%= f.label :state %>
<%= f.select :state, options_for_select(PatientManager::Constants::STATES, @patient.state) %>
`
<%= f.label :zip %>
<%= f.text_field :zip %>
<%= f.label :home_phone %>
<%= f.text_field :home_phone %>
<%= f.label :work_phone %>
<%= f.text_field :work_phone %>
<%= f.label :cell_phone %>
<%= f.text_field :cell_phone %>
<%= f.label :email %>
<%= f.email_field :email %>
<%= f.label :organization_id %>
<%= f.select :organization_id, options_from_collection_for_select(PatientManager::Organization.all, :id, :name, @patient.organization_id) %>
<% f.fields_for :documents, PatientManager::Document.new do |d| %>
<%= d.label :document %>
<%= d.file_field :document %>
<% end %>
<% f.fields_for :notes, PatientManager::Note.new do |n| %>
<%= n.label :content, 'Note' %>
<%= n.text_area :content %>
<% end %>
<div class="form-actions">
<%= f.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment