mardi 5 septembre 2017

Devise after user login create action with table relationship

after User login with devise_token_auth then create operation_system name with "android" or "ios" so what should i do?

class CreateOperatingSystems < ActiveRecord::Migration[5.1]
  def change
    create_table :operating_systems do |t|
      t.string :name
      t.references :user, foreign_key: true

      t.timestamps
    end
  end
end

class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table(:users) do |t|
       .......................
    end
  end
end

Aucun commentaire:

Enregistrer un commentaire