Tag: 简单的forms

与has_many的Simple_Form关联:通过额外字段

我有两个模型,开发人员和任务, class Developer :assignments end class Task :assignments end class Assignment < ActiveRecord::Base attr_accessible :accomplished_time, :developer_id, :estimated_time, :status, :task_id belongs_to :task belongs_to :developer end 我通过添加一个Assignment表来处理关系,所以我可以将许多开发人员添加到一个任务中,现在我也希望能够操作我添加到连接表中的其他字段,如’estimated_time’,’ completed_time’…等……我在Simple_form上得到的是` { :class => ‘form-horizontal’ } do |f| %> :check_boxes %> ‘btn-primary’ %> t(“helpers.links.cancel”)), project_sprint_path(@sprint.project_id,@sprint), :class => ‘btn’ %> ` 这只允许我选择开发人员,我希望能够在那里修改estimated_time字段。 有什么建议?