Hi, I am a bit of a rails novice and trying to work this out. Been
tearing my hair out over this for a long time.
I have 2 models that I am working on at the moment. The idea is that
Teams have many players and Players have many teams. I want to be able
to assign a starting team to a player when they are created.
class Team < ActiveRecord::Base
has_and_belongs_to_many :players
class Player < ActiveRecord::Base
has_and_belongs_to_many :teams
*Note: I have set up the correct join table and can insert these
relationships from the ruby console. *
I am indeed that a form_for. When I put an f. infrount i get an error.
undefined method `merge' for [["1st Team", 1], ["2nd Team", 2]]:Array
Just to confirm. Without the f. the form loads however no Team data gets sent to the Params on the create. Sorry that is a bit vauge and probably the wrong way of saying it!