Skip to content

Commit

Permalink
Merge pull request #5 from bvipul/develop
Browse files Browse the repository at this point in the history
Added csrf token to new modules and also in Module Management
  • Loading branch information
bvipul authored Apr 2, 2019
2 parents 72e3f3f + c416d2b commit e30162b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/views/Stubs/index_view.stub
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<script>
//Below written line is short form of writing $(document).ready(function() { })
$(function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});

var dataTable = $('#dummy_small_plural_model-table').dataTable({
processing: true,
serverSide: true,
Expand Down
7 changes: 6 additions & 1 deletion src/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@
@section('after-scripts')
{{-- For DataTables --}}
{{ Html::script(mix('js/dataTable.js')) }}

<script>
$(function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
var dataTable = $('#modules-table').dataTable({
processing: true,
serverSide: true,
Expand Down

0 comments on commit e30162b

Please sign in to comment.