Hello I have a model named Client which has nested models called Receiver and Receipt.Basically a client donate money to a receiver or many receivers, and that gift appear in a receipt.
model/client.rb
class Client < ActiveRecord::Base
has_many :receivers
has_many :receipts
accepts_nested_attributes_for :receivers
accepts_nested_attributes_for :receipts
end
views/client/_form.html.erb
<%= simple_form_for @client do |f| %>
<%= f.input :name %>
<%= f.input :input %>
<%= f.input :suscribtion_number %>
<%= simple_fields_for :orders do |o| %>
<%= o.input :name %>
<% end %>
<%= f.button :submit %>
<% end %>
Matter fact how can I dynamically transfer a client "input" to 1- an oder's "amount"(attribute) 2- and to a receipt's "amount"(attribute)
f
. Give the second one another name, for example.