Skip to content

Instantly share code, notes, and snippets.

@dpmccabe
Created November 3, 2011 22:14
Show Gist options
  • Save dpmccabe/1337962 to your computer and use it in GitHub Desktop.
Save dpmccabe/1337962 to your computer and use it in GitHub Desktop.
//Jay's additions to Active Admin:
$(document).ready(function() {
function changeSubcategories(selection) {
// entrance_page = $("#title_bar a:eq(2)").text();
data = { 'data': selection } //, 'entrance_page': ent }
$.post("/get_subcategories", data);
}
//changeSubcategories();
$("#entrance_page_source_category_id").change(function() {
changeSubcategories($("#entrance_page_source_category_id option:selected").text());
});
$("#_source_category").change(function() {
changeSubcategories($("#_source_category option:selected").text());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment