avo-hq/avo

field: pass all html options

オープン

#3,145 opened on 2024/08/16

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)Ruby (308 件のフォーク)user submission
EnhancementHelp wantedStale exempt

Repository metrics

Stars
 (1,778 個のスター)
PR merge metrics
 (平均マージ 1d 6h) (30d で 67 merged PRs)

説明

Feature

https://docs.avohq.io/3.0/field-options.html#html only allow for style, classes, or data. It would be great (just as like with mapkick_options for maps) that you pass ALL options to the html field (instead of only the whilelisted ones)

field :name, as: :text, html: {
  edit: {
    wrapper: {
      min: 1,
      max:  100,
      pattern: ...,
    }
}

(sidenote: when this same logic is used within actions, we can also consider https://github.com/avo-hq/avo/issues/2803 closed)

Current workarounds

None

Additional context

This can (amongst other) help to create html validations where relevant

  • min
  • max
  • pattern
  • minlength
  • ...

コントリビューターガイド