开发者

An array of nested forms, but I do not want the previous completed objects to show

I have an Object where the object has a nested form of which can be duplicated as needed.

开发者_JS百科

To accomplish this I am using :

- 2.times { @organization.referrals.build }
- form_for @organization do |f|
  = f.error_messages
  - f.fields_for :referrals do |qf|
    = render :partial => 'referral_fields', :locals => {:qf => qf}

Now I have two blank referrals for them to fill out. But I do not want the user to see the older created referrals. How do I keep the nested model form, but dissalow the end user from seeing the previously created objects?


Something like this should work...

f.fields_for @organization.referrals.select{|r| r.new_record?} do |qf|
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜