次の関連付けがあるプロジェクトでsimple_formを使用しています
Company
has_many :users
has_many :projects
User
belongs_to :company
has_many :tasks
Project
belongs_to :company
has_many :tasks
Task
belongs_to :project
belongs_to :user
私は次のようなsimple_formアソシエーション入力を使用しています:
<%= f.association :user, :prompt => "Assign To...", :label_method => :first_name, :value_method => :id %>
ただし、正しいcompany_id(プロジェクトが属するものと同じ)を持つユーザーのみをリストする必要があります。これを行う方法はありますか?私はいくつかのグーグルを行い、これまで何も思いつきませんでした。