Show object column using association in simple_form

「Show object column using association in simple_form」のアイキャッチ画像

You can show specific column name in association check_boxes in simple form.
Like this.

= f.association :prefectures, as: :check_boxes,
      label_method: lambda { |prefecture|  JpPrefecture::Prefecture.find(prefecture.prefecture_code).name}
目次
  1. References

References

Simple form association custom label name