mardi 12 janvier 2016

Add new button in has_many in activeadmin rails

f.has_many :offers,heading: 'Offers' do |item|
  item.input :quantity
  item.input :offer_type_id, :prompt => 'Select Offer Type', :as => :select, :collection => OfferType.all.map{|m| [m.title, m.id]}
    item.input :_destroy, :as => :boolean
end

It works fine and has_many association created. I want that the button for adding associated data automatically clicked or open when I load page.

Add new Offer

Instead that user click on it for first associated data it automatically clicked

Aucun commentaire:

Enregistrer un commentaire