0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「form_with」で使用できるタグ一覧

Last updated at Posted at 2024-10-06

form_with で使用できるタグ一覧

form_with はRailsでフォームを簡単に作成できるメソッド
その主要な入力フィールドと補助的なフィールド一覧

主要タグ

  1. label

    • ラベル表示
    • 例: f.label :name
  2. text_field

    • 一般的なテキスト入力フィールド
    • 例: f.text_field :name
  3. email_field

    • メールアドレス入力用
    • 例: f.email_field :email
  4. password_field

    • パスワード入力用
    • 例: f.password_field :password
  5. hidden_field

    • 隠しフィールド
    • 例: f.hidden_field :auth_token
  6. text_area

    • 複数行テキスト入力
    • 例: f.text_area :description
  7. select

    • ドロップダウンメニュー
    • 例: f.select :gender, options_for_select(['Male', 'Female'])
  8. submit

    • 送信ボタン
    • 例: f.submit '送信する'

補助タグ

  1. number_field

    • 数値入力用
    • 例: f.number_field :age
  2. file_field

    • ファイルアップロード用
    • 例: f.file_field :avatar
  3. check_box

    • チェックボックス
    • 例: f.check_box :accept_terms
  4. radio_button

    • ラジオボタン
    • 例: f.radio_button :gender, 'male'
  5. date_field

    • 日付入力用
    • 例: f.date_field :birthdate
  6. range_field

    • スライダー入力
    • 例: f.range_field :progress

随時追加していきます。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?