问题标签 [object-address]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby-on-rails - Rails 简单表单 gem 中的选择字段返回对象(十六进制)地址
我对 project_assignment、expence_types 和 assignment_expences 表使用 has_many through 关系。我添加新费用的简单表格,我有:
<%= f.association :project_assignment, prompt: 'choose...', collection: ProjectAssignment.where('active = ?', true).order(:task) %>
这应该显示来自现场任务(表 project_assignments)的任务描述,但它返回一个对象地址。
我在同一个表格上还有另一个例子:
<%= f.association :expence_type, prompt: 'choose...', collection: ExpenceType.where('active = ?', true).order(:name), right_column_html: { class: 'col-md-1 col-lg-1' } %>
效果很好。显示名称。我读过它在将对象转换为字符串时显示地址,但我无法使其工作。任何帮助,将不胜感激。