docbrown/app/assets/javascripts/initializers/initializeDashboardSort.js
Andrew Brown 1168b926c7 be able to sort dashboard articles (#1837) (#2337)
* be able to sort dashboard articles (#1837)

* remember to escape order clause is arel (#1837)

* add back in missing character for created_at (#1837)

* use case statement to avoid threat of injection (#1837)

* write specs to ensure sorting works for dashboard articles (#1837)

* add publish sort options, refactor sort options into articles helper (#1837)

* refactor to use model scope (#1837)
2019-04-15 08:30:09 -04:00

7 lines
230 B
JavaScript

function initializeDashboardSort() {
if (document.getElementById('dashhboard_sort')) {
document.getElementById('dashhboard_sort').onchange = function() {
window.location = '/dashboard?sort=' + this.value;
};
}
}