フォームにドロップダウン選択を作成しようとしています。 教室モデル: class Classroom < ApplicationRecord
has_and_belongs_to_many :professors
end
教授モデル: class Professor < ApplicationRecord
has_and_belongs_to_many :classroo
私は2つのテーブルを持っていますarticlesとtagsと第3の関連テーブルarticles_tags今、私は新しい記事を作成するときにarticles_tagsにデータを保存したいと思います。 public function add()
{
$article = $this->Articles->newEntity();
if ($this->request->is('p
私は、リクエストのリストを表示するテーブルを作成しています。IDの 'erp_createdid'と 'erp_productid'の間に関係があります。製品の名前を表示するために、私はbelongsToManyを作成しました。私は自分の2つの「ID」を指定します。 注文モデル class Order extends Model
{
protected $table = 'erp_or
私が持っている3モデル:店のモデル、製品モデル、次のモデル 店のモデルは、このようなものです: class Product extends Model
{
protected $fillable = ['store_id','category_id','name', 'photo','description'];
...
}
次のモデルがある: class Store