Nested tree view with Ruby on Rails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Nested tree view with Ruby on Rails

Shyamkirubha Swaminathan

Dear All,

In ROR, I have a model 'Document', which may contain Section, Table, Text_field. Therefore, I have 4 models, and I use ancestry for Section as it may contain Sub-Section. Also, Table and Text_field belongs to Document, and optionally belongs to Section. So, structure will look like below:




I could successfully iterate and print this structure as List in my view. But I would like to show the data as Treeview. Is there a way I could achieve this with Ruby on Rails?

Thanks for any suggestions.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a3ddf6d6-d224-4be6-b1f3-8b459473ef42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Nested tree view with Ruby on Rails

Walter Lee Davis

> On Mar 23, 2018, at 12:56 AM, Shyamkirubha Swaminathan <[hidden email]> wrote:
>
> Dear All,
>
> In ROR, I have a model 'Document', which may contain Section, Table, Text_field. Therefore, I have 4 models, and I use ancestry for Section as it may contain Sub-Section. Also, Table and Text_field belongs to Document, and optionally belongs to Section. So, structure will look like below:
>
>
>
>
>
>
>
>
>
> I could successfully iterate and print this structure as List in my view. But I would like to show the data as Treeview. Is there a way I could achieve this with Ruby on Rails?

Can you describe or refer to an example of a tree view? What is that exactly? Do you mean something like the ancient Windows 3 little [+] and [-] controls to expand and collapse a list?

Walter

>
> Thanks for any suggestions.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a3ddf6d6-d224-4be6-b1f3-8b459473ef42%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D51AE2F5-406F-4461-90FD-BC1195AE4389%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Nested tree view with Ruby on Rails

Joe Guerra
In reply to this post by Shyamkirubha Swaminathan
try this gem.

https://github.com/collectiveidea/awesome_nested_set

On Friday, March 23, 2018 at 2:17:24 AM UTC-4, Shyamkirubha Swaminathan wrote:

Dear All,

In ROR, I have a model 'Document', which may contain Section, Table, Text_field. Therefore, I have 4 models, and I use ancestry for Section as it may contain Sub-Section. Also, Table and Text_field belongs to Document, and optionally belongs to Section. So, structure will look like below:


<a href="https://lh3.googleusercontent.com/-PVxJEhU0rOU/WrSIxYPphrI/AAAAAAAAKH4/_Ob3jGZtb6c7027-WeaA11CipI41_5SjgCLcBGAs/s1600/Capture.JPG" style="margin-left:1em;margin-right:1em" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://lh3.googleusercontent.com/-PVxJEhU0rOU/WrSIxYPphrI/AAAAAAAAKH4/_Ob3jGZtb6c7027-WeaA11CipI41_5SjgCLcBGAs/s1600/Capture.JPG&#39;;return true;" onclick="this.href=&#39;https://lh3.googleusercontent.com/-PVxJEhU0rOU/WrSIxYPphrI/AAAAAAAAKH4/_Ob3jGZtb6c7027-WeaA11CipI41_5SjgCLcBGAs/s1600/Capture.JPG&#39;;return true;">



I could successfully iterate and print this structure as List in my view. But I would like to show the data as Treeview. Is there a way I could achieve this with Ruby on Rails?

Thanks for any suggestions.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9c209672-057f-405b-8894-38cbd02a50e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.