Questions tagged [nested-forms]

A form within another form, often in the ruby-on-rails environment.

This is a Rails gem for conveniently manage multiple nested models in a single form. It does so in an unobtrusive way through jQuery or Prototype.

This gem only works with Rails 3.

Nested forms are when a form is placed within another form, often in the environment.

As of HTML 5, the form element can't be nested. Check section 4.10.18, "Association of controls and forms" for more information.

The platform can also handle nested forms, like the example below:

<div class="form">
    <?php $this->renderPartial('_form', array('form'=>$form)); ?>
    <?php echo $form['user']; ?>
    <?php echo $form['profile']; ?>
    <?php echo $form['subformbuttons']; ?>
</div>

Check the section for general questions and details about forms.

1948 questions
0
votes
1 answer

Rails Cocoon Delete/Destroy Single Instance

I am using Cocoon gem to associate resume fields to one resume, and each user has ONE resume and have everything working the correct way via cocoon documentation. However, I would like the ability for users to be able to edit resume fields/nested…
Fdwillis
  • 960
  • 8
  • 20
0
votes
1 answer

ActiveAdmin form: multiple nested forms

I have a structure User-> Profile-> Image and want to use one form for editing and recording in ActiveAdmin. I use accepts_nested_attributes_forin models: class User < ActiveRecord::Base has_one :profile, dependent: :destroy; …
0
votes
0 answers

Nested Form with Many-to-Many relationship - Rails

I'm learning Rails and I'am pretty stuck building a nested form with many to many relationship. I was able to get the many-to-many relationship working with has_many :through, but when it comes down to create the views and the controllers to get it…
bruninhu
  • 27
  • 5
0
votes
2 answers

Two nested form objects

I have two nested objects (Attachment inside Widget, Widget inside Lesson). Lesson > Widgets > Attachments Lesson > Widgets > Links Everything is fine, but if I click on "Remove attachment", and then I click on "Update Lesson", nested attachments in…
0
votes
2 answers

Nested_attributes dont appear in my params

I'm trying to include nested_form in one of my model new form. <%= form_for :master_box, url: master_boxes_path do |f| %> <%= f.label :number %>
<%= f.text_field :number %> <%= f.fields_for :orders do |o| %>
Hiro
  • 37
  • 1
  • 6
0
votes
1 answer

rails 4 nested_form not saving

I know there is a lot questions like this before, I have following all the answer, but still mine doesn't work. please help. survey.rb # app/models/survey.rb class Survey < ActiveRecord::Base has_many :questions, :dependent => :destroy …
junior
  • 802
  • 14
  • 24
0
votes
1 answer

Nested form in Play! Scala 2.2

I have read several times the documentation but I still have problems with my nested form in Play! Scala 2.2 (detailed further). Here is my form :
first name :
Simon
  • 4,844
  • 4
  • 32
  • 69
0
votes
1 answer

Behaviour of assign_attributes with nested forms

assign_attributes doesn't seem to recognise when I delete nested objects. I have a model called Order: class Order < ActiveRecord::Base has_many :deliveries, :dependent => :destroy accepts_nested_attributes_for :deliveries,…
user3711600
  • 753
  • 2
  • 7
  • 27
0
votes
2 answers

Uninitialized constant using nested forms in Rails

I keep getting an error saying uninitialized constant Page::PageAttachment when trying to create a nested form using the nested_form gem. Here is some relevant code. Let me know if you need any other code or have any questions. Stacktrace isn't…
ryanpitts1
  • 690
  • 1
  • 13
  • 31
0
votes
1 answer

has_many field_for and nested attributes

I am tryng to learning nested attributes with a simple app. class Ticket < ActiveRecord::Base has_many :avatars accepts_nested_attributes_for :avatars end class Avatar < ActiveRecord::Base belongs_to :ticket end <%= form_for @ticket…
0
votes
1 answer

nested form, empty symbol for has_many relationship

So, after I have migrated our application from rails 2 to 3.2, I’ve implemented a nested form for a new class, which has worked perfectly. Unfortunately, I cannot get the same to work with a migrated class and it's keeping me on the edge for days…
spaceman
  • 31
  • 6
0
votes
1 answer

Nested attributes / form: Unpermitted params

I've been going over the active record nested attributes docs and strong params docs but must be missing something as my logs tell me that ownership, and image are still not being permitted: User Load (0.3ms) SELECT "users".* FROM "users" WHERE…
Jadam
  • 991
  • 1
  • 13
  • 30
0
votes
0 answers

Rails nested form unable to do save

I have a single form which Application model which accepts personal attributes and Contact attributes. Contact attributes in turn accepts Mobile attributes. I am getting NoMethodError in ApplicationsController#create and undefined method 'mobile'…
0
votes
1 answer

Display user friendly Devise nested validation errors

I have a nested form on my Devise sign-up page. I have a Company model linked to the User via a Role model. See here for a related post: How do I update a nested resource without passing the data via a form I can set my validations etc. and they…
0
votes
1 answer

How do I update a nested resource without passing the data via a form

Models class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable has_many :roles, :dependent => :destroy, :inverse_of => :user has_many :companies, :through…
Dan Tappin
  • 1,753
  • 2
  • 26
  • 48
1 2 3
99
100