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?

Enter image details here

  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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -