Skip to content

Commit

Permalink
Fix paths for teacher validate/deny
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed May 5, 2021
1 parent 289f871 commit cd6dcd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/views/main/_deny_modal.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
</div>

<script type="text/javascript">
modal = $('.js-denialModal');
let modal = $('.js-denialModal');
modal.on('shown.bs.modal', function (event) {
var button = $(event.relatedTarget);
var teacherid = button.data('teacherid');
var teachername = button.data('teachername');
var newaction = '/admin/forms/deny/' + teacherid;
let button = $(event.relatedTarget);
let teacherId = button.data('teacher-id');
let teachername = button.data('teachername');
let newaction = `/teachers/${teacherId}/deny`;
modal.find('.form-horizontal').attr('action', newaction);
modal.find('.modal-title').text('Deny ' + teachername);
});
Expand Down
4 changes: 2 additions & 2 deletions app/views/main/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<%= render 'teachers/teacher', teacher: teacher %>
<td>
<div class="btn-group" role="group" aria-label="Validate or Remove Teacher">
<%= button_to("✔️", teacher_validate_path(:id => teacher.id),
<%= button_to("✔️", teacher_validate_path(teacher_id: teacher.id),
class: 'btn btn-outline-success', type: 'button') %>
<span>
<button class="btn btn-outline-danger" type="button" data-toggle="modal" data-target=".js-denialModal" data-teacherid="<%= teacher.id %>" data-teachername="<%= teacher.full_name %>">
</button>
</span>
<%# <%= button_to("Delete", teacher_delete_path(:id => teacher.id),
<%# <%= button_to("Delete", teacher_delete_path(teacher_id: teacher.id),
data: {confirm: "Are you sure you wish to delete this form?"},
class: 'btn btn-danger', type: 'button') %>
</div>
Expand Down

0 comments on commit cd6dcd8

Please sign in to comment.