HI All,
I am currently creating an Admin utility for courier management service, where I need to include a form to submit two users(same model) on same form, I don’t know to implement exactly but duplicated the user form twice which is displaying the form twice on the browser but unable to save the both the users, listed below my Admin customer register file and attached the screen shot for your reference .
Also want to know, how to add additional business logics to admin, for example adding print functionality for the single user on ‘view’ page.
ActiveAdmin.register Customer do
form do |f| #User one f.inputs “Sender Details” do
f.input :name
f.input :email
f.input :street
f.input :city
f.input :state
f.input :pin
f.input :customer_type,:as => :select, :collection => [["Package Sender", "Package Sender"], ["Package Receiver","Package Receiver"]]
end
#User two
f.inputs “Receiver Details” do
f.input :name
f.input :email
f.input :street
f.input :city
f.input :state
f.input :pin
f.input :customer_type,:as => :select, :collection => [["Package Sender", "Package Sender"], ["Package Receiver","Package Receiver"]]
end
f.inputs do
f.has_many :packages do |p|
p.input :weight
p.input :amount
p.input :received_date
p.input :amount
end
end
f.buttons
end end
regards, Loganathan