|
|
|
@ -54,7 +54,7 @@ export default class extends ApplicationController { |
|
|
|
if (value.length === 0) { |
|
|
|
if (value.length === 0) { |
|
|
|
if ($selectize.length) $selectize[0].selectize.clearOptions(); |
|
|
|
if ($selectize.length) $selectize[0].selectize.clearOptions(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$.get("/api/doctrines.json", { subject_ids: value }, function(data, status) { |
|
|
|
$.get("/api/doctrines/suggested_contents.json", { subject_ids: value }, function(data, status) { |
|
|
|
if (status === "success") { |
|
|
|
if (status === "success") { |
|
|
|
$.each(data, function (i, doctrine) { |
|
|
|
$.each(data, function (i, doctrine) { |
|
|
|
selectize_options.push({ id: doctrine.id, value: doctrine.content, text: doctrine.plain_content }); |
|
|
|
selectize_options.push({ id: doctrine.id, value: doctrine.content, text: doctrine.plain_content }); |
|
|
|
|