Top "Nested-attributes" questions

RubyOnRails allows you to access attributes of objects associated with the main model, using one, deep hash.

Rails 4 - Strong Parameters - Nested Objects

I've got a pretty simple question. But haven't found a solution so far. So here's the JSON string I send …

ruby-on-rails ruby-on-rails-4 nested-attributes strong-parameters
Can't mass-assign protected attributes

Updating the code formatting for better viewing. Folks, I have been looking at this for sometime but I don't understand …

ruby-on-rails nested-attributes mass-assignment
Rails after_initialize only on "new"

I have the following 2 models class Sport < ActiveRecord::Base has_many :charts, order: "sortWeight ASC" has_one :product, :as =&…

ruby-on-rails model nested-attributes
accepts_nested_attributes_for with has_many => :through Options

I have two models, links and tags, associated through a third, link_tags. The following code is in my Link …

ruby-on-rails has-many-through nested-attributes
Getting fields_for and accepts_nested_attributes_for to work with a belongs_to relationship

I cannot seem to get a nested form to generate in a rails view for a belongs_to relationship using …

ruby-on-rails ruby associations nested-attributes
Rails 3: How does "accepts_nested_attributes_for" work?

Consider the following association: class Product < ActiveRecord::Base belongs_to :shop accepts_nested_attributes_for :shop end If params[:…

ruby-on-rails ruby-on-rails-3 nested-attributes
accepts_nested_attributes_for with belongs_to polymorphic

I would like set up a polymorphic relation with accepts_nested_attributes_for. Here is the code: class Contact <…

ruby-on-rails ruby polymorphic-associations nested-attributes
Does accepts_nested_attributes_for work with belongs_to?

I have been getting all kinds of conflicting information regarding this basic question, and the answer is pretty crucial to …

ruby-on-rails-3 nested-attributes belongs-to
WARNING: Can't mass-assign protected attributes

I get this error "WARNING: Can't mass-assign protected attributes: races_attributes" , when following this http://railscasts.com/episodes/196-nested-model-form-part-1 on …

ruby-on-rails-3 nested-attributes
How should I use rails and simple_form for nested resources?

I'm trying to create one resource with another nested resource at the same time. I'm using Rails4 and simple_form 3.0.0…

ruby-on-rails simple-form nested-attributes fields-for strong-parameters