excid3 / madmin

A robust Admin Interface for Ruby on Rails apps
https://github.com/excid3/madmin
MIT License
606 stars 66 forks source link

Where would I setup specific form helpers for different field types? #202

Closed Shpigford closed 7 months ago

Shpigford commented 7 months ago

I want to make use of various Rails form helpers for certain field types.

For instance, for datetime columns I'd like the form field to use datetime_select.

excid3 commented 7 months ago

You can either:

  1. Override the view for an existing field type. Copy the view to your Rails app in the same folder and change it. For example, this one replacing the text_field: https://github.com/excid3/madmin/blob/main/app/views/madmin/fields/date_time/_form.html.erb
  2. Generate a new field type https://github.com/excid3/madmin?tab=readme-ov-file#custom-fields