I am working on a Project where there as two models, (User,Project). They have many to many relationship and is implemented by has_many through which is (UserProject). I want the functionality that when I am creating a project, below projects models fields, all the db users should be listed below having checkbox in front of each. When user enters all the projects model fields and checks the checkboxes for example 2 checkboxes below(2 users), All the data should be saved which includes projects creation as well as two records of UserProject. Is there any way of doing this.. I am using form_with helper. User(id,email,password) Project(id,name) UserProject(id,user_id,project_id)
Save multiple records using form_with in one go using nested approach
108 views Asked by Muhammad Ans At
1
There are 1 answers
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in RUBY
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- Duplicate GET requests - Rails & Heroku
- convert csv file with json data inside to a column, rows table in 2nd csv file
- Installing dependencies from a gemspec file
- Verifying Google Identity OAuth2 token with Ruby
- Java code of AES/GCM/NoPadding encryption algorithm with authentication tag
- How to fix error in model with gem lockbox
- Cannot install Ruby Gem on Window
- use logstash filter ,aes gcm encrypted in ruby,but cannot decrypted in java
- In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
- How can I go through an array and still remove elements from it
- Nokogiri only returning 5 results
- How do I get the fullscreen mode in firefox?
- undefined group option when using branch reset group regex in Ruby
Related Questions in NESTED
- Python, Exchange specific values in a nested list
- IF AND OR Nested ArrayFormula not working - What am I missing?
- Subset a nested list by a nested list of indices
- How can I easily assign a value (short notatio) to a property of a nested class in php 8+?
- return all paths in a nested dictionary that also contains a list in python
- Absolute path of a child element within nested structure
- How to sum non-empty successive rows in deeply nested tibbles in R?
- Can a nested object call a method from its nesting object?
- How to group flexbox items with DIV but without influencing layout, as if DIV was not there?
- Streamlit multiple nested buttons, not working
- batch file - nested for loop with wildcards
- ForEach loop won't dynamically add entries
- printing list and variable names in triple nested for loop in R does not behave as expected
- Python - convert from JSON to CSV
- Pyspark how to avoid explode for groups in the top and nested structure (code optimalisation)
Related Questions in FORM-HELPERS
- How to insert the "data-empreendimento-id" property in each option?
- Fatal error: Uncaught FatalErrorException: [MissingHelperException] Helper class FormHelper could not be found cake php 2.x
- How to get all value from the same name of input text fields in codeigniter4?
- Form Helper form_open() not working in CodeIgniter 4
- How to set rails form helper with counter
- .NET how to disable FluentValidation with formHelper on certain submit button
- How to replace "Update" button by "Save" and "Cancel" buttons in a Ruby on Rails application with "form_with" form helper?
- Save multiple records using form_with in one go using nested approach
- Django crispy forms - bootstrap4 table_inline_formset template rendering extra row on top
- html form input method get prevent name in url if value is not filled
- How to add a tags input functionality in rails form or how to add array to input field?
- why is button_to not working with method: :put with slim in rails
- CakePHP 3 - Displaying date from database table to an edit formhelper page
- How to add a horizontal rule in bootstrap?
- can I add a 'span' after label using a FormHelper in CakePHP 3?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If I'm understanding correctly, you want a form with sub-objects in it and a single submit.
I have done this in the past by
#building the empty objects, so that they can be displayed in the form, and then handling them "correctly" in the params section:Controller:
view:
I hope this helps.