We've moved discussions to Discord

Error: User and Team required

Nathan Rofkahr •
So I've been trying to figure this out for way too many hours now. I'm sure somebody here knows exactly why this isn't working. Obviously, should NOT have a User and Team input field.

Literally just set up Jumpstart... any ideas?

Screen Shot 2020-01-23 at 8.50.20 PM.png 83 KB
Nathan Rofkahr •
Migration:
class CreateOrganizations < ActiveRecord::Migration[6.0]
  def change
    create_table :organizations do |t|
      t.references :user, null: false, foreign_key: true
      t.references :team, null: false, foreign_key: true
      t.string :name
      t.string :website

      t.timestamps
    end
  end
end
Chris Oliver •
Rails scaffolds always include a form field for associations you generate. Since you generated Organizations with associations to User and Team, they're included in the form.

Nothing unique to Jumpstart.

Just delete them if you don't want them in the form and set the values in the controller. 👍
Nathan Rofkahr •
Thanks Chris - I'm just a noob. Jumpstart is awesome btw. 👏 
Chris Oliver •
All good my dude! That's what we're here for! 🤘
Nathan Rofkahr •
Fixed :)
Notifications
You’re not receiving notifications from this thread.