Assuming I create a method within my plugin.rb file to set these values programmatically how could I access them through an xhr request?
Is there a way to expose internal plugin methods to the outside world?
For example something like
//plugin.rb file contents
def update_fields
//Save fields
end
//plugin.js contents
Discourse.ajax("plugin#update_fields", {
type: 'POST',
dataType: 'json',
data: {#}
}).then(function(json) { //On success
}, function(json) { //On error
});