You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following schema project has_many tasks. Employee has_many projects and has_many tasks through projects.
classEmployee < ActiveRecord::Basehas_many:projects,inverse_of: :employeehas_many:tasks,through: :projectsrails_admindoeditdofield:projectsfield:tasksdooptions_source_paramsdo{"f[project_id_in]"=>bindings[:object].try(:project_ids) || [-1]}endhtml_attributesdo{data: {# set project's field as dependent select box"dependant-filteringselect"=>"field=project_ids",# post parameters"dependant-param"=>"f[project_id_in]"}}endendfield:name# other fieldsendend
The 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
The text was updated successfully, but these errors were encountered:
Given the following schema project has_many tasks. Employee has_many projects and has_many tasks through projects.
The 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
The text was updated successfully, but these errors were encountered: