4 ms·
I don't have a well-formed opinion on this, but how would you propose handling nested attributes if mass assignment protection was managed in the controller?
by nfm 15y ago
I don't have a well-formed opinion on this, but how would you propose handling nested attributes if mass assignment protection was managed in the controller?
- derekprior 15y agoHow about a nested hash of attributes? class PostsController attr_accessible: :title, :body, :related_links => { :href, :title } end This would accept the attributes: post_title, post_body, post_related_links_0_href, post_related_links_0_title, posts_related_ink_1... The names might not be right. I forget exactly how rails names fields. But you get the point, yes?