nested-attributes
Rails: Change _destroy functionality?
I\'m using accepts_nested_attributes_for for some nested resources and am using the _destroy flag to remove an item on form save.[详细]
2023-02-23 12:01 分类:问答rails 3 accepts nested attributes not working
I am trying to use nested attributes on my user model for settings so that I can edit the user info and the setting info in a single page.Here is my code:[详细]
2023-02-23 02:13 分类:问答Rails 3 - Nested Forms and Default Values
I am trying to create form that contains another model in rails. I have accomplished this with using accepts_nested_attibutes and it is working great. The problem is I开发者_StackOverflow中文版 have[详细]
2023-02-22 22:05 分类:问答Rails accepts_nested_attributes_for _destroy doesnt work unless associations are already loaded
Rails 3.0.5 doesn\'t seem to destroy children of a parent object using accepts_nested_attributes_for unless the children are loaded. Does anyone know if this is by design?It seems a b开发者_StackOverf[详细]
2023-02-22 18:06 分类:问答Check for nested attributes in before_save
When you submit a form to the controller for saving in ActiveRecord, you can add missing fields via @foo.field = \'bar\'. I would like to do the same thing for a nested attribute, but I cannot figure[详细]
2023-02-22 06:23 分类:问答Why can't I build more than one nested attribute here?
this is my form code: <%= simple_form_for setup_video(@video) do |f| %> <% f.fields_for :comment_titles do |t| %>[详细]
2023-02-21 15:36 分类:问答What's the best Rails convention for this?
Let\'s say that you have a resource that is created and displayed entirely within the view of开发者_Python百科 another resource (eg. comments or tags). Should you still make it it\'s own resource, or[详细]
2023-02-21 11:24 分类:问答Setting attribute of one model in the create view of another model
I have a user model that has_one profile, and the profile belongs to the user. The profile has a type column for single table inheritance that is either \"artist\" or \"listener\". I want the user to[详细]
2023-02-20 08:21 分类:问答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 rails 3.[详细]
2023-02-20 05:08 分类:问答check box not showing check Rails
I have a parent model that accepts child attributes. class User < ActiveRecord::Base accepts_nested_attributes_for :spec[详细]
2023-02-20 01:39 分类:问答