Dynamic nested form (new gem by me)

36 views
Skip to first unread message

Ariel Juodziukynas

unread,
Apr 10, 2019, 4:41:18 PM4/10/19
to Ruby on Rails: Talk

Hi, I want to share a gem that I'm working on.


https://github.com/arielj/vanilla-nested/



It's a replacement of the cocoon gem (dymanic nested forms) but using only vanilla javascript so no jQuery dependency. I'm already using it on one of my projects and it has a few config options to customize it for different requirements.


You can find some examples on theREADME at github (it's really similar to cocoon).


For now, it can only be added as a git repo (I'll see how I can publish it as a gem on rubygems).


gem 'vanilla_nested', git: 'https://github.com/arielj/vanilla-nested', branch: 'master'


I'd really really apreciate if you test it and can give me some feedback (ideally on github)!


Thanks!


Joe Guerra

unread,
Apr 11, 2019, 10:00:29 AM4/11/19
to Ruby on Rails: Talk
Very nice.

Juan Ignacio Villarejo Arzivian

unread,
Apr 11, 2019, 10:53:28 AM4/11/19
to Ruby on Rails: Talk
Hey Ariel! 

Good initiative! I think it would really come handy a GIF image with a visual example of how it does. 
I suggest this because from the description I don't get how would it be the look and feel of the nested form. Of course cocoon has the same issue.
An image is a thousand words and a GIF is a thousand images. 

Congrats and keep it up. Removing JQuery dependency it's a great plus. 

Ariel Juodziukynas

unread,
Apr 11, 2019, 11:12:55 AM4/11/19
to rubyonra...@googlegroups.com
Hi! The look and feel does not depend on the gem, it just adds/removes some html (defined by the user) to/from an specific container when you click a button. The actual look depends on the form defined and styled by the user. I'll try to add a gif with an use example though, thanks!!

--
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 rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f373ff8a-81d9-48b4-91ef-2cb5cb0632fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

localho...@gmail.com

unread,
Apr 11, 2019, 2:09:45 PM4/11/19
to Ruby on Rails: Talk
pretty cool, I was using a jQuery based one and moved to stimulus, greatest choice I ever made I think:

Reply all
Reply to author
Forward
0 new messages