Displaying 1 result from an estimated 1 matches for "document_fields_form".
2011 Sep 01
0
do you think it's the best solution?
...restrict
has_many :roles, :dependent => :restrict
accepts_nested_attributes_for :documents
accepts_nested_attributes_for :roles
the shop _form is:
= simple_form_for(@shop) do |shop_f|
= render ''shared/error_messages'', :object => @shop
= render :partial => ''document_fields_form'', :locals => { :f =>
shop_f } if @shop.new_record? or @document
= field_set_tag t(''shop'') do
.inputs
= shop_f.input :name
.............
I want to create a new document only if I''m inserting a new shop
record or if @document is defined.
Shop_contro...