Simple form association custom label name

You’ll have to use the :label_method option for this.

<%= f.association :owner_type, :include_blank => false, :label_method => lambda { |owner| "#{owner.name} | #{owner.subtype_name}" } %>

or, if you define a select_label method on the owner’s class, you can do

<%= f.association :owner_type, :include_blank => false, :label_method => :select_label %>

Leave a Comment