hungle00 / rondo_form Goto Github PK
View Code? Open in Web Editor NEWSame as Cocoon, but using StimulusJS https://rubygems.org/gems/rondo_form
License: MIT License
Same as Cocoon, but using StimulusJS https://rubygems.org/gems/rondo_form
License: MIT License
Every new form that is added renders with new_{association}.
#<ActionController::Parameters {"authenticity_token"=>"3kUjG2E7cVsYIYFgIdTKIgvwe0tgEUuB5WL510s5q515S4-hZnsjv7O-cKv-Q6qAv6b49HPTlxBfl6CpLxQamA", "automation"=>{"name"=>"Pinny 3", "imagination_id"=>"1", "frequencies_attributes"=>{"0"=>{"post_frequency"=>"daily", "days_of_the_week"=>"tuesday", "time_of_day"=>"1:30", "_destroy"=>"false"}, "new_frequencies"=>{"post_frequency"=>"daily", "days_of_the_week"=>"friday", "time_of_day"=>"8:00", "_destroy"=>"false"}}}, "button"=>"", "controller"=>"automations", "action"=>"create"} permitted: false>
In this code, if I had added 2 more new frequencies the last one would overwrite the ones before.
How are you getting around that?
Help is appreciated.
Hello!
I deploy my application via dokku (docker) to my own Hetzner VPS and have:
ActionController::RoutingError (No route matches [GET] "/assets/controllers/nested_rondo_controller")
browser console:
Request URL: https://pm.23.88.117.56.sslip.io/assets/nested_rondo_controller
Status Code:
404 Not Found
I already have few Stimulus controllers in the application and they are all working in the production, except rondo controller.
What additional steps should I take to make it work?
I already did asset:precompile, :clobber, :clean and such stuff, but no luck
Rails 7, importmaps, ruby "3.2.2"
javascript/cotnroller/index.js:
import NestedRondoController from "./nested_rondo_controller"
application.register("nested-rondo", NestedRondoController)
Should I more specifically set a path somewhere to this controller?
Thanks in advance!
UPDATE:
Not sure if it is a correct approach or I found a real issue.
I just commented out these lines in index.js and controller works fine in the production:
import NestedRondoController from "./nested_rondo_controller"
application.register("nested-rondo", NestedRondoController)
since this already loading all the controllers:
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)
Hello! Thanks for the gem.
From the description I understand that this gem is exactly what I need. I struggle a lot with adding additional form fields.
But I can't adapt the code to standard rail's form helpers.
I simplified a view and even not using a partials, but can't figure out how the link to add and remove associations should look like:
= form_with(model: [@user, @invoice]) do |form|
.flex.flex-col
= form.label :invoice_number, 'Invoice number'
= form.text_field :number, class: "text-field"
.......
.my-4{data: {controller: "nested-rondo", "nested-rondo-field-class-value" => "line-item-form"}}
%div{data: {"nested-rondo-target" => "fieldContain"}}
%div{class: "line-item-form"}
= form.fields_for :line_items do |line_item_form|
= line_item_form.label :name, "service or product"
.....
= line_item_form.text_field :quantity, class: "text-field"
= link_to_add_association "Add line item" **???**
= link_to_remove_association "Remove Task" **???**
I was using a partials and now I don't and probably this has very simple solution.
Can you please give some clue for how it should like with standard form helpers.
update oh..m nevermind, I installed simple forms, made everything using it and then reverse engineered it back to standard rails' helpers, now it works.
my star and my heart goes to you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.