Giter Site home page Giter Site logo

rondo_form's People

Contributors

hungle00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rondo_form's Issues

new_{association}_attribute

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.

rondo form in production

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)

Use with standard rails form helpers

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.