excid3 / madmin

A robust Admin Interface for Ruby on Rails apps

Home Page:https://github.com/excid3/madmin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Shpigford opened this issue · comments

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.

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