TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.97k stars 177 forks source link

Added ability to exclude form fields through the DSL #517

Closed pbendersky closed 3 weeks ago

pbendersky commented 4 weeks ago

This PR adds the ability to exclude certain form fields when using the automatic form generator through the DSL.

This is an alternative take on #416 where it was done globally through the configuration.

spohlenz commented 3 weeks ago

I definitely don't dislike this but I have an alternative proposal in #519 that adds support for the following:

Trestle.resource(:articles) do
  table exclude: [:updated_at, :created_at]
  form exclude: [:updated_at, :created_at]
end

I would be interested in your thoughts.

pbendersky commented 3 weeks ago

I like how the DSL in #519 reads better than the one I proposed here. I'll close this PR in favor of #519 (go for it whenever you feel like, as it seems to be a frequently requested thing).