Created
March 25, 2015 18:29
-
-
Save EminenceHC/999a36ca2f084436888b to your computer and use it in GitHub Desktop.
Query Optimization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@reviews = Review.all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<thead> | |
<td>Date</td> | |
<td>Student First</td> | |
<td>Student Last</td> | |
<td>Case No.</td> | |
<td>Employee</td> | |
<td>School</td> | |
<td>Service</td> | |
<td>Stage</td> | |
<td>Review</td> | |
</thead> | |
<tbody> | |
<% @reviews.each do |r| %> | |
<tr> | |
<td><%= r.date.strftime('%m/%d/%Y') %></td> | |
<td> | |
<% student = Student.find_by(case_no: r.case_no)%> | |
<% if student.present? %> | |
<%= student.user.first_name %> | |
<% end %> | |
</td> | |
<td> | |
<% if student.present? %> | |
<%= student.user.last_name %> | |
<% end %> | |
</td> | |
<td><%= r.case_no %></td> | |
<td><%= Counselor.find_by(employee_no: r.employee_no).user.full_name %></td> | |
<td><%= School.find_by(id: r.school_id).name %></td> | |
<td><%#= r.reviewable_type.sub('Review', '').sub('AdministrativeDischarge', 'Discharge (Administrative)').sub('TreatmentPlan', 'Treatment Plan').gsub('Asi', 'ASI').gsub('Continuation', 'Continuation of Treatment') %></td> | |
<td><%= Review.stage_wording(r.stage) %></td> | |
<td> | |
<% if r.stage == 2 %> | |
<%= link_to 'Metadata Updated', toggle_metadata_reviews_path(id: r.id), class: 'btn btn-mini' %> | |
<% elsif r.stage == 0 %> | |
<%= link_to 'Start Review', toggle_review_reviews_path(id: r.id), class: 'btn btn-mini', target: '_blank' %> | |
<% else %> | |
<%= link_to 'Review', [:edit, r.reviewable], class: 'btn btn-mini', target: '_blank' %> | |
<% end %> | |
</td> | |
</tr> | |
<% end %> | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment