-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Given the following schema project has_many tasks. Employee has_many projects and has_many tasks through projects.
class Employee < ActiveRecord::Base
has_many :projects, inverse_of: :employee
has_many :tasks, through: :projects
rails_admin do
edit do
field :projects
field :tasks do
options_source_params do
{ "f[project_id_in]" => bindings[:object].try(:project_ids) || [-1] }
end
html_attributes do
{ data: {
# set project's field as dependent select box
"dependant-filteringselect" => "field=project_ids",
# post parameters
"dependant-param" => "f[project_id_in]" }
}
end
end
field :name
# other fields
end
endThe problem is when project field is empty. Then no project_id is sent in options request to TasksController. This means that all tasks are shown
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels