2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

simple_formを使うと、collection_selectで表示が崩れる

Posted at

simple_formを使って、collection_selectで表示が崩れる場合

= f.collection_select :article_type_id, ArticleType.all, :id, :name

これだと表示が崩れます。

= f.input :article_type_id, collection: ArticleType.all, label_method: :name, value_method: :id, include_blank: false

これでちゃんと表示されます。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?