ruby on rails - Add Collection group with ancestry -
Using Iam with location model If users choose parents to showcase children, then what children Show to the siblings?
User _form.html. How can I apply in ARB?
class space & Lt; ActiveRecord :: Base is _Naishchery: cache_depth = & gt; The true has_many: end users
lineage
This process will be relatively simple, considering the ancestor
you can get several ways to get it:
To pass the related object to what you want to do, change the change in javascript < / Code> functions make your controls Through which it will give you the required results:
# config / routes.rb Resources: Location: End of siblings # app / controller / Sthanon_ controller. RB Class Level Controller & lt; ApplicationController repsond_to: json, only :: Brother sister df siblings @ location = location.fand parameter [: id] response_with @ location.children # - & gt;
This will allow you to define AJAX methods to manage feedback from the data:
# apps / assets / javascripts / application.js $ (Document) .on ("change", "#your_select", function () {var id = $ (this) .val (); $ .ajax ({url: "/ places /" + id + "/ brother Sister ", data: tie:" Jason ", success: function (data) {// add results to your other selected box}});});
This should give you the necessary functionality
Comments
Post a Comment