Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class Seller < ApplicationRecord
  2. has_many :buyer_sellers
  3. has_many :buyers, :through => :buyer_sellers
  4. end
  5.  
  6. class Buyer < ApplicationRecord
  7. has_many :buyer_sellers
  8. has_many :sellers, :through => :buyer_sellers
  9. end
  10.  
  11. class BuyerSeller < ApplicationRecord
  12. belongs_to :buyer
  13. belongs_to :seller
  14. end
  15.  
  16. <%= form_for(buyer) do |f| %>
  17. <%= some fields %>
  18.  
  19. <%= f.fields_for :buyer_seller do |ff| %>
  20. <% ff.date_select :start_date %>
  21. <% end %>
  22.  
  23. <% end %>
  24.  
  25. Buyer Load (3.1ms) SELECT "buyers".* FROM "buyers" WHERE "buyers"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
  26. Unpermitted parameter: buyer_seller
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement